@andreyshpigunov/x 0.4.4 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/css/app.css +1 -1
- package/assets/js/app.js +1 -1
- package/cheatsheet.html +18 -14
- package/dist/x.css +1 -1
- package/dist/x.js +1 -1
- package/index.html +102 -102
- package/package.json +1 -1
- package/src/components/x/animate.js +1 -1
- package/src/components/x/buttons.css +191 -187
- package/src/components/x/colors.css +57 -35
- package/src/components/x/dropdown.css +127 -123
- package/src/components/x/dropdown.js +19 -19
- package/src/components/x/flex.css +141 -137
- package/src/components/x/flow.css +35 -31
- package/src/components/x/form.css +97 -93
- package/src/components/x/grid.css +99 -94
- package/src/components/x/helpers.css +915 -912
- package/src/components/x/icons.css +40 -36
- package/src/components/x/lib.js +4 -4
- package/src/components/x/links.css +63 -59
- package/src/components/x/modal.css +218 -214
- package/src/components/x/modal.js +23 -23
- package/src/components/x/reset.css +166 -162
- package/src/components/x/scroll.css +77 -71
- package/src/components/x/sheets.css +6 -2
- package/src/components/x/slider.css +74 -70
- package/src/components/x/space.css +30 -26
- package/src/components/x/sticky.css +18 -14
- package/src/components/x/sticky.js +5 -5
- package/src/components/x/typo.css +208 -205
- package/src/css/x.css +20 -17
|
@@ -9,50 +9,54 @@ All right reserved.
|
|
|
9
9
|
|
|
10
10
|
/*
|
|
11
11
|
.icon - base icon style
|
|
12
|
-
.icon
|
|
12
|
+
.icon[10-60] step 2 (m,l) - icon size in px
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.icon
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.icon > img {
|
|
26
|
-
display: block;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@for $i from 10 to 60 by 2 {
|
|
30
|
-
.icon.s$(i),
|
|
31
|
-
.icon.s$(i) > svg,
|
|
32
|
-
.icon.s$(i) > img {
|
|
33
|
-
width: calc($(i)rem / 10);
|
|
34
|
-
height: calc($(i)rem / 10);
|
|
15
|
+
@layer icons {
|
|
16
|
+
|
|
17
|
+
.icon,
|
|
18
|
+
.icon > svg,
|
|
19
|
+
.icon > img {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
width: 1em;
|
|
22
|
+
height: 1em;
|
|
23
|
+
max-width: none;
|
|
24
|
+
max-height: none;
|
|
35
25
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
.icon > svg,
|
|
27
|
+
.icon > img {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
|
|
39
31
|
@for $i from 10 to 60 by 2 {
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.
|
|
32
|
+
.icon$(i),
|
|
33
|
+
.icon$(i) > svg,
|
|
34
|
+
.icon$(i) > img {
|
|
43
35
|
width: calc($(i)rem / 10);
|
|
44
36
|
height: calc($(i)rem / 10);
|
|
45
37
|
}
|
|
46
38
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
|
|
40
|
+
@media (min-width: 768px) {
|
|
41
|
+
@for $i from 10 to 60 by 2 {
|
|
42
|
+
.m\:icon$(i),
|
|
43
|
+
.m\:icon$(i) > svg,
|
|
44
|
+
.m\:icon$(i) > img {
|
|
45
|
+
width: calc($(i)rem / 10);
|
|
46
|
+
height: calc($(i)rem / 10);
|
|
47
|
+
}
|
|
56
48
|
}
|
|
57
49
|
}
|
|
50
|
+
|
|
51
|
+
@media (min-width: 1024px) {
|
|
52
|
+
@for $i from 10 to 60 by 2 {
|
|
53
|
+
.l\:icon$(i),
|
|
54
|
+
.l\:icon$(i) > svg,
|
|
55
|
+
.l\:icon$(i) > img {
|
|
56
|
+
width: calc($(i)rem / 10);
|
|
57
|
+
height: calc($(i)rem / 10);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
}
|
package/src/components/x/lib.js
CHANGED
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
* const items = lib.qsa('li', container);
|
|
91
91
|
*
|
|
92
92
|
* Classes with delay (for transitions):
|
|
93
|
-
* await lib.addClass('.element', 'active', 100); // Adds
|
|
94
|
-
* await lib.removeClass('.element', 'active', 200); // Removes active, waits 200ms, removes
|
|
93
|
+
* await lib.addClass('.element', 'active', 100); // Adds _ready class, waits 100ms, then adds active
|
|
94
|
+
* await lib.removeClass('.element', 'active', 200); // Removes active, waits 200ms, removes _ready
|
|
95
95
|
*
|
|
96
96
|
* Formatting:
|
|
97
97
|
* lib.price(1234.56); // "1 234.56"
|
|
@@ -333,7 +333,7 @@ class Lib {
|
|
|
333
333
|
if (!len) return;
|
|
334
334
|
|
|
335
335
|
if (delay > 0) {
|
|
336
|
-
const readyClass = className.replace(
|
|
336
|
+
const readyClass = className.replace(/_.*/, '') + '_ready';
|
|
337
337
|
for (let i = 0; i < len; i++) items[i].classList.add(readyClass);
|
|
338
338
|
await new Promise(res => setTimeout(res, delay));
|
|
339
339
|
}
|
|
@@ -357,7 +357,7 @@ class Lib {
|
|
|
357
357
|
|
|
358
358
|
if (delay > 0) {
|
|
359
359
|
await new Promise(res => setTimeout(res, delay));
|
|
360
|
-
const readyClass = className.replace(
|
|
360
|
+
const readyClass = className.replace(/_.*/, '') + '_ready';
|
|
361
361
|
for (let i = 0; i < len; i++) items[i].classList.remove(readyClass);
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -14,11 +14,11 @@ All right reserved.
|
|
|
14
14
|
a.link
|
|
15
15
|
a.hover
|
|
16
16
|
a.active
|
|
17
|
-
a.
|
|
18
|
-
a.
|
|
19
|
-
a.
|
|
20
|
-
a.
|
|
21
|
-
a.
|
|
17
|
+
a.link_noline
|
|
18
|
+
a.link_underline
|
|
19
|
+
a.link_dashed
|
|
20
|
+
a.link_dotted
|
|
21
|
+
a.link_wavy
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
:root {
|
|
@@ -41,70 +41,74 @@ All right reserved.
|
|
|
41
41
|
*/
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
@layer links {
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
}
|
|
49
|
-
&:link,
|
|
50
|
-
&.link {
|
|
51
|
-
outline: none;
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
color: var(--link-color);
|
|
54
|
-
transition: var(--link-transition, all .1s ease-out);
|
|
46
|
+
a {
|
|
55
47
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
48
|
+
&[role=button] {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
&:link,
|
|
52
|
+
&.link {
|
|
53
|
+
outline: none;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
color: var(--link-color);
|
|
56
|
+
transition: var(--link-transition, all .1s ease-out);
|
|
57
|
+
|
|
58
|
+
text-decoration-line: var(--link-decoration-line);
|
|
59
|
+
text-decoration-style: var(--link-decoration-style);
|
|
60
|
+
text-decoration-color: var(--link-decoration-color, color-mix(in srgb, currentcolor, transparent 75%));
|
|
61
|
+
text-decoration-thickness: clamp(1px, var(--link-decoration-thickness, .06em), 10px);
|
|
62
|
+
text-underline-offset: var(--link-underline-offset, .25em);
|
|
63
|
+
}
|
|
64
|
+
&:visited {
|
|
65
|
+
color: var(--link-color-visited, var(--link-color));
|
|
66
|
+
text-decoration-color: var(--link-decoration-color-visited, currentcolor);
|
|
67
|
+
}
|
|
68
|
+
@media (any-hover: hover) {
|
|
69
|
+
&:hover,
|
|
70
|
+
&.hover {
|
|
71
|
+
color: var(--link-color-hover, var(--link-color));
|
|
72
|
+
text-decoration-line: var(--link-decoration-line-hover, var(--link-decoration-line));
|
|
73
|
+
text-decoration-style: var(--link-decoration-style-hover, var(--link-decoration-style));
|
|
74
|
+
text-decoration-color: var(--link-decoration-color-hover, currentcolor);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
&:active,
|
|
78
|
+
&.active {
|
|
69
79
|
color: var(--link-color-hover, var(--link-color));
|
|
70
80
|
text-decoration-line: var(--link-decoration-line-hover, var(--link-decoration-line));
|
|
71
81
|
text-decoration-style: var(--link-decoration-style-hover, var(--link-decoration-style));
|
|
72
82
|
text-decoration-color: var(--link-decoration-color-hover, currentcolor);
|
|
73
83
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
|
|
85
|
+
/* Link predefined styles */
|
|
86
|
+
|
|
87
|
+
&.link_noline {
|
|
88
|
+
--link-decoration-line: none;
|
|
89
|
+
}
|
|
90
|
+
&.link_underline {
|
|
91
|
+
--link-decoration-line: underline;
|
|
92
|
+
}
|
|
93
|
+
&.link_dashed {
|
|
94
|
+
--link-decoration-style: dashed;
|
|
95
|
+
}
|
|
96
|
+
&.link_dotted {
|
|
97
|
+
--link-decoration-style: dotted;
|
|
98
|
+
}
|
|
99
|
+
&.link_wavy {
|
|
100
|
+
--link-decoration-style: wavy;
|
|
101
|
+
}
|
|
81
102
|
}
|
|
82
103
|
|
|
83
|
-
/* Link predefined styles */
|
|
84
104
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
--link-decoration-style: dashed;
|
|
93
|
-
}
|
|
94
|
-
&.link--dotted {
|
|
95
|
-
--link-decoration-style: dotted;
|
|
96
|
-
}
|
|
97
|
-
&.link--wavy {
|
|
98
|
-
--link-decoration-style: wavy;
|
|
105
|
+
/* Remove underline from phones */
|
|
106
|
+
|
|
107
|
+
a[href^="tel"],
|
|
108
|
+
a[href^="tel"]:hover,
|
|
109
|
+
a[href^="tel"]:active {
|
|
110
|
+
color: inherit;
|
|
111
|
+
text-decoration: inherit;
|
|
99
112
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/* Remove underline from phones */
|
|
104
113
|
|
|
105
|
-
a[href^="tel"],
|
|
106
|
-
a[href^="tel"]:hover,
|
|
107
|
-
a[href^="tel"]:active {
|
|
108
|
-
color: inherit;
|
|
109
|
-
text-decoration: inherit;
|
|
110
114
|
}
|