@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.
@@ -9,50 +9,54 @@ All right reserved.
9
9
 
10
10
  /*
11
11
  .icon - base icon style
12
- .icon.s[10-60] step 2 (m,l) - icon size in px
12
+ .icon[10-60] step 2 (m,l) - icon size in px
13
13
  */
14
14
 
15
- .icon,
16
- .icon > svg,
17
- .icon > img {
18
- display: inline-block;
19
- width: 1em;
20
- height: 1em;
21
- max-width: none;
22
- max-height: none;
23
- }
24
- .icon > svg,
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
- @media (min-width: 768px) {
26
+ .icon > svg,
27
+ .icon > img {
28
+ display: block;
29
+ }
30
+
39
31
  @for $i from 10 to 60 by 2 {
40
- .m\:icon.s$(i),
41
- .m\:icon.s$(i) > svg,
42
- .m\:icon.s$(i) > img {
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
- @media (min-width: 1024px) {
50
- @for $i from 10 to 60 by 2 {
51
- .l\:icon.s$(i),
52
- .l\:icon.s$(i) > svg,
53
- .l\:icon.s$(i) > img {
54
- width: calc($(i)rem / 10);
55
- height: calc($(i)rem / 10);
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
  }
@@ -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 --ready class, waits 100ms, then adds active
94
- * await lib.removeClass('.element', 'active', 200); // Removes active, waits 200ms, removes --ready
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(/--.*/, '') + '--ready';
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(/--.*/, '') + '--ready';
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.link--noline
18
- a.link--underline
19
- a.link--dashed
20
- a.link--dotted
21
- a.link--wavy
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
- a {
44
+ @layer links {
45
45
 
46
- &[role=button] {
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
- text-decoration-line: var(--link-decoration-line);
57
- text-decoration-style: var(--link-decoration-style);
58
- text-decoration-color: var(--link-decoration-color, color-mix(in srgb, currentcolor, transparent 75%));
59
- text-decoration-thickness: clamp(1px, var(--link-decoration-thickness, .06em), 10px);
60
- text-underline-offset: var(--link-underline-offset, .25em);
61
- }
62
- &:visited {
63
- color: var(--link-color-visited, var(--link-color));
64
- text-decoration-color: var(--link-decoration-color-visited, currentcolor);
65
- }
66
- @media (any-hover: hover) {
67
- &:hover,
68
- &.hover {
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
- &:active,
76
- &.active {
77
- color: var(--link-color-hover, var(--link-color));
78
- text-decoration-line: var(--link-decoration-line-hover, var(--link-decoration-line));
79
- text-decoration-style: var(--link-decoration-style-hover, var(--link-decoration-style));
80
- text-decoration-color: var(--link-decoration-color-hover, currentcolor);
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
- &.link--noline {
86
- --link-decoration-line: none;
87
- }
88
- &.link--underline {
89
- --link-decoration-line: underline;
90
- }
91
- &.link--dashed {
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
  }