@andreyshpigunov/x 0.5.0 → 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.
@@ -21,143 +21,147 @@ All right reserved.
21
21
  --dropdown-divider-color: var(--color-grey);
22
22
  }
23
23
 
24
- [x-dropdown] {
25
- display: none;
26
- list-style: none;
27
- position: absolute;
28
- top: 100%;
29
- z-index: 1000;
30
- opacity: 0;
31
- min-width: 22rem;
32
- max-width: var(--dropdown-max-width);
33
- max-height: clamp(0px, 80vh, 500px);
34
- overflow: auto;
35
- list-style: none;
36
- padding: var(--dropdown-padding);
37
- margin: 0;
38
- background-color: var(--dropdown-backgroud-color);
39
- border: none;
40
- box-shadow: var(--dropdown-box-shadow);
41
- border-radius: var(--dropdown-border-radius);
42
- transform: scale(.95);
43
- transform-origin: top;
44
- transition: opacity .15s ease-out,
45
- transform .15s ease-out;
46
- pointer-events: none;
47
- overscroll-behavior: contain;
24
+ @layer dropdown {
48
25
 
49
- @media (min-width: 768px) {
50
- max-width: calc(var(--dropdown-max-width) * 1.2);
51
- }
52
-
53
- & > li {
54
- margin: 0;
55
- }
56
-
57
- &::-webkit-scrollbar {
58
- width: var(--scroll-scrollbar-size);
59
- height: var(--scroll-scrollbar-size);
60
- }
61
-
62
- &::-webkit-scrollbar-track {
63
- background-color: none;
64
- border-radius: var(--scroll-scrollbar-size);
65
- }
66
-
67
- &::-webkit-scrollbar-thumb {
68
- border-radius: var(--scroll-scrollbar-size);
69
- background-color: var(--scroll-scrollbar-thumb-background);
70
- will-change: background-color;
71
- transition: background .2s ease-out;
72
- cursor: pointer;
73
- }
74
-
75
- &::-webkit-scrollbar-thumb:hover {
76
- background-color: var(--scroll-scrollbar-thumb-background-hover);
77
- }
78
-
79
- &::-webkit-scrollbar-button,
80
- &::-webkit-scrollbar-track-piece,
81
- &::-webkit-scrollbar-corner,
82
- &::-webkit-resizer {
26
+ [x-dropdown] {
83
27
  display: none;
84
- }
85
- }
86
-
87
- .dropdown {
88
- position: relative;
89
-
90
- &.dropdown_right > [x-dropdown] {
91
- right: 0;
92
- left: auto;
93
- }
94
- &.dropdown_bottom > [x-dropdown] {
95
- bottom: 100%;
96
- top: auto;
97
- transform-origin: bottom;
98
- }
99
- &.dropdown_ready > [x-dropdown] {
100
- display: block;
101
- pointer-events: auto;
102
- }
103
- &.dropdown_open > [x-dropdown] {
104
- opacity: 1;
105
- transform: scale(1);
106
- }
107
- &.dropdown_wrap > [x-dropdown] li {
108
- & > a,
109
- & > span {
110
- white-space: wrap;
28
+ list-style: none;
29
+ position: absolute;
30
+ top: 100%;
31
+ z-index: 1000;
32
+ opacity: 0;
33
+ min-width: 22rem;
34
+ max-width: var(--dropdown-max-width);
35
+ max-height: clamp(0px, 80vh, 500px);
36
+ overflow: auto;
37
+ list-style: none;
38
+ padding: var(--dropdown-padding);
39
+ margin: 0;
40
+ background-color: var(--dropdown-backgroud-color);
41
+ border: none;
42
+ box-shadow: var(--dropdown-box-shadow);
43
+ border-radius: var(--dropdown-border-radius);
44
+ transform: scale(.95);
45
+ transform-origin: top;
46
+ transition: opacity .15s ease-out,
47
+ transform .15s ease-out;
48
+ pointer-events: none;
49
+ overscroll-behavior: contain;
50
+
51
+ @media (min-width: 768px) {
52
+ max-width: calc(var(--dropdown-max-width) * 1.2);
53
+ }
54
+
55
+ & > li {
56
+ margin: 0;
57
+ }
58
+
59
+ &::-webkit-scrollbar {
60
+ width: var(--scroll-scrollbar-size);
61
+ height: var(--scroll-scrollbar-size);
62
+ }
63
+
64
+ &::-webkit-scrollbar-track {
65
+ background-color: none;
66
+ border-radius: var(--scroll-scrollbar-size);
67
+ }
68
+
69
+ &::-webkit-scrollbar-thumb {
70
+ border-radius: var(--scroll-scrollbar-size);
71
+ background-color: var(--scroll-scrollbar-thumb-background);
72
+ will-change: background-color;
73
+ transition: background .2s ease-out;
74
+ cursor: pointer;
75
+ }
76
+
77
+ &::-webkit-scrollbar-thumb:hover {
78
+ background-color: var(--scroll-scrollbar-thumb-background-hover);
79
+ }
80
+
81
+ &::-webkit-scrollbar-button,
82
+ &::-webkit-scrollbar-track-piece,
83
+ &::-webkit-scrollbar-corner,
84
+ &::-webkit-resizer {
85
+ display: none;
111
86
  }
112
87
  }
113
- }
114
-
115
-
116
- [x-dropdown] {
117
88
 
118
- & li {
89
+ .dropdown {
90
+ position: relative;
119
91
 
120
- &.divider {
121
- height: 0;
122
- padding: 0;
123
- margin: var(--dropdown-padding) calc(-1 * var(--dropdown-padding));
124
- border-bottom: 1px solid var(--dropdown-divider-color);
92
+ &.dropdown_right > [x-dropdown] {
93
+ right: 0;
94
+ left: auto;
125
95
  }
126
-
127
- & > a,
128
- & > span {
96
+ &.dropdown_bottom > [x-dropdown] {
97
+ bottom: 100%;
98
+ top: auto;
99
+ transform-origin: bottom;
100
+ }
101
+ &.dropdown_ready > [x-dropdown] {
129
102
  display: block;
130
- padding: var(--dropdown-item-padding);
131
- line-height: 1.4;
132
- color: var(--dropdown-item-font-color);
133
- white-space: nowrap;
134
- text-overflow: ellipsis;
135
- text-decoration: none;
136
- overflow: hidden;
137
- border: none;
138
- border-radius: calc(var(--dropdown-border-radius) / 2);
139
- background: var(--dropdown-item-background-color);
103
+ pointer-events: auto;
140
104
  }
141
-
142
- & > a {
143
- will-change: color, background, transform;
144
- transition: all .1s ease-out;
105
+ &.dropdown_open > [x-dropdown] {
106
+ opacity: 1;
145
107
  transform: scale(1);
146
- transform-origin: bottom center;
108
+ }
109
+ &.dropdown_wrap > [x-dropdown] li {
110
+ & > a,
111
+ & > span {
112
+ white-space: wrap;
113
+ }
114
+ }
115
+ }
116
+
117
+
118
+ [x-dropdown] {
119
+
120
+ & li {
147
121
 
148
- &:focus-visible,
149
- &.focus-visible,
150
- &:hover,
151
- &.hover,
152
- &:active,
153
- &.active {
154
- color: var(--dropdown-item-font-color-hover);
155
- background: var(--dropdown-item-background-color-hover);
122
+ &.divider {
123
+ height: 0;
124
+ padding: 0;
125
+ margin: var(--dropdown-padding) calc(-1 * var(--dropdown-padding));
126
+ border-bottom: 1px solid var(--dropdown-divider-color);
156
127
  }
157
128
 
158
- &:active {
159
- transform: scale(.99);
129
+ & > a,
130
+ & > span {
131
+ display: block;
132
+ padding: var(--dropdown-item-padding);
133
+ line-height: 1.4;
134
+ color: var(--dropdown-item-font-color);
135
+ white-space: nowrap;
136
+ text-overflow: ellipsis;
137
+ text-decoration: none;
138
+ overflow: hidden;
139
+ border: none;
140
+ border-radius: calc(var(--dropdown-border-radius) / 2);
141
+ background: var(--dropdown-item-background-color);
142
+ }
143
+
144
+ & > a {
145
+ will-change: color, background, transform;
146
+ transition: all .1s ease-out;
147
+ transform: scale(1);
148
+ transform-origin: bottom center;
149
+
150
+ &:focus-visible,
151
+ &.focus-visible,
152
+ &:hover,
153
+ &.hover,
154
+ &:active,
155
+ &.active {
156
+ color: var(--dropdown-item-font-color-hover);
157
+ background: var(--dropdown-item-background-color-hover);
158
+ }
159
+
160
+ &:active {
161
+ transform: scale(.99);
162
+ }
160
163
  }
161
164
  }
162
165
  }
166
+
163
167
  }
@@ -29,168 +29,172 @@ All right reserved.
29
29
  .flex > .c[1-12]/[1-12] (s,m,l,xl) - column width "column/columns"
30
30
  */
31
31
 
32
- .flex { display: flex }
33
-
34
- [class*=flex] {
35
- /* Columns */
36
- @for $cols from 1 to 12 {
37
- @for $col from 1 to $cols {
38
- & > .c$(col)\/$(cols) {
39
- flex-basis: calc($(col) / $(cols) * 100%);
40
- max-width: calc($(col) / $(cols) * 100%);
41
- }
42
- }
43
- }
32
+ @layer flex {
33
+
34
+ .flex { display: flex }
44
35
 
45
- @media (min-width: 640px) {
36
+ [class*=flex] {
37
+ /* Columns */
46
38
  @for $cols from 1 to 12 {
47
39
  @for $col from 1 to $cols {
48
- & > .s\:c$(col)\/$(cols) {
40
+ & > .c$(col)\/$(cols) {
49
41
  flex-basis: calc($(col) / $(cols) * 100%);
50
42
  max-width: calc($(col) / $(cols) * 100%);
51
43
  }
52
44
  }
53
45
  }
54
- }
55
-
56
- @media (min-width: 768px) {
57
- @for $cols from 1 to 12 {
58
- @for $col from 1 to $cols {
59
- & > .m\:c$(col)\/$(cols) {
60
- flex-basis: calc($(col) / $(cols) * 100%);
61
- max-width: calc($(col) / $(cols) * 100%);
46
+
47
+ @media (min-width: 640px) {
48
+ @for $cols from 1 to 12 {
49
+ @for $col from 1 to $cols {
50
+ & > .s\:c$(col)\/$(cols) {
51
+ flex-basis: calc($(col) / $(cols) * 100%);
52
+ max-width: calc($(col) / $(cols) * 100%);
53
+ }
62
54
  }
63
55
  }
64
56
  }
65
- }
66
-
67
- @media (min-width: 1024px) {
68
- @for $cols from 1 to 12 {
69
- @for $col from 1 to $cols {
70
- & > .l\:c$(col)\/$(cols) {
71
- flex-basis: calc($(col) / $(cols) * 100%);
72
- max-width: calc($(col) / $(cols) * 100%);
57
+
58
+ @media (min-width: 768px) {
59
+ @for $cols from 1 to 12 {
60
+ @for $col from 1 to $cols {
61
+ & > .m\:c$(col)\/$(cols) {
62
+ flex-basis: calc($(col) / $(cols) * 100%);
63
+ max-width: calc($(col) / $(cols) * 100%);
64
+ }
73
65
  }
74
66
  }
75
67
  }
76
- }
77
-
78
- @media (min-width: 1280px) {
79
- @for $cols from 1 to 12 {
80
- @for $col from 1 to $cols {
81
- & > .xl\:c$(col)\/$(cols) {
82
- flex-basis: calc($(col) / $(cols) * 100%);
83
- max-width: calc($(col) / $(cols) * 100%);
68
+
69
+ @media (min-width: 1024px) {
70
+ @for $cols from 1 to 12 {
71
+ @for $col from 1 to $cols {
72
+ & > .l\:c$(col)\/$(cols) {
73
+ flex-basis: calc($(col) / $(cols) * 100%);
74
+ max-width: calc($(col) / $(cols) * 100%);
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ @media (min-width: 1280px) {
81
+ @for $cols from 1 to 12 {
82
+ @for $col from 1 to $cols {
83
+ & > .xl\:c$(col)\/$(cols) {
84
+ flex-basis: calc($(col) / $(cols) * 100%);
85
+ max-width: calc($(col) / $(cols) * 100%);
86
+ }
84
87
  }
85
88
  }
86
89
  }
87
90
  }
88
- }
89
-
90
- .fr { flex-direction: row }
91
- .fc { flex-direction: column }
92
- .fw { flex-wrap: wrap }
93
- .fnw { flex-wrap: nowrap }
94
-
95
- .ais { align-items: stretch }
96
- .aifs { align-items: flex-start }
97
- .aic { align-items: center }
98
- .aife { align-items: flex-end }
99
-
100
- .jcfs { justify-content: flex-start }
101
- .jcc { justify-content: center }
102
- .jcfe { justify-content: flex-end }
103
- .jcsb { justify-content: space-between }
104
- .jcsa { justify-content: space-around }
105
- .jcse { justify-content: space-evenly }
106
-
107
- .no-shrink { flex-shrink: 0 }
108
- .no-grow { flex-grow: 0 }
109
-
110
- @media (min-width: 640px) {
111
- .s\:fr { flex-direction: row }
112
- .s\:fc { flex-direction: column }
113
- .s\:fw { flex-wrap: wrap }
114
- .s\:fnw { flex-wrap: nowrap }
115
-
116
- .s\:ais { align-items: stretch }
117
- .s\:aifs { align-items: flex-start }
118
- .s\:aic { align-items: center }
119
- .s\:aife { align-items: flex-end }
120
91
 
121
- .s\:jcfs { justify-content: flex-start }
122
- .s\:jcc { justify-content: center }
123
- .s\:jcfe { justify-content: flex-end }
124
- .s\:jcsb { justify-content: space-between }
125
- .s\:jcsa { justify-content: space-around }
126
- .s\:jcse { justify-content: space-evenly }
92
+ .fr { flex-direction: row }
93
+ .fc { flex-direction: column }
94
+ .fw { flex-wrap: wrap }
95
+ .fnw { flex-wrap: nowrap }
127
96
 
128
- .s\:no-shrink { flex-shrink: 0 }
129
- .s\:no-grow { flex-grow: 0 }
130
- }
131
-
132
- @media (min-width: 768px) {
133
- .m\:fr { flex-direction: row }
134
- .m\:fc { flex-direction: column }
135
- .m\:fw { flex-wrap: wrap }
136
- .m\:fnw { flex-wrap: nowrap }
97
+ .ais { align-items: stretch }
98
+ .aifs { align-items: flex-start }
99
+ .aic { align-items: center }
100
+ .aife { align-items: flex-end }
137
101
 
138
- .m\:ais { align-items: stretch }
139
- .m\:aifs { align-items: flex-start }
140
- .m\:aic { align-items: center }
141
- .m\:aife { align-items: flex-end }
102
+ .jcfs { justify-content: flex-start }
103
+ .jcc { justify-content: center }
104
+ .jcfe { justify-content: flex-end }
105
+ .jcsb { justify-content: space-between }
106
+ .jcsa { justify-content: space-around }
107
+ .jcse { justify-content: space-evenly }
142
108
 
143
- .m\:jcfs { justify-content: flex-start }
144
- .m\:jcc { justify-content: center }
145
- .m\:jcfe { justify-content: flex-end }
146
- .m\:jcsb { justify-content: space-between }
147
- .m\:jcsa { justify-content: space-around }
148
- .m\:jcse { justify-content: space-evenly }
109
+ .no-shrink { flex-shrink: 0 }
110
+ .no-grow { flex-grow: 0 }
149
111
 
150
- .m\:no-shrink { flex-shrink: 0 }
151
- .m\:no-grow { flex-grow: 0 }
152
- }
153
-
154
- @media (min-width: 1024px) {
155
- .l\:fr { flex-direction: row }
156
- .l\:fc { flex-direction: column }
157
- .l\:fw { flex-wrap: wrap }
158
- .l\:fnw { flex-wrap: nowrap }
112
+ @media (min-width: 640px) {
113
+ .s\:fr { flex-direction: row }
114
+ .s\:fc { flex-direction: column }
115
+ .s\:fw { flex-wrap: wrap }
116
+ .s\:fnw { flex-wrap: nowrap }
117
+
118
+ .s\:ais { align-items: stretch }
119
+ .s\:aifs { align-items: flex-start }
120
+ .s\:aic { align-items: center }
121
+ .s\:aife { align-items: flex-end }
122
+
123
+ .s\:jcfs { justify-content: flex-start }
124
+ .s\:jcc { justify-content: center }
125
+ .s\:jcfe { justify-content: flex-end }
126
+ .s\:jcsb { justify-content: space-between }
127
+ .s\:jcsa { justify-content: space-around }
128
+ .s\:jcse { justify-content: space-evenly }
129
+
130
+ .s\:no-shrink { flex-shrink: 0 }
131
+ .s\:no-grow { flex-grow: 0 }
132
+ }
159
133
 
160
- .l\:ais { align-items: stretch }
161
- .l\:aifs { align-items: flex-start }
162
- .l\:aic { align-items: center }
163
- .l\:aife { align-items: flex-end }
134
+ @media (min-width: 768px) {
135
+ .m\:fr { flex-direction: row }
136
+ .m\:fc { flex-direction: column }
137
+ .m\:fw { flex-wrap: wrap }
138
+ .m\:fnw { flex-wrap: nowrap }
139
+
140
+ .m\:ais { align-items: stretch }
141
+ .m\:aifs { align-items: flex-start }
142
+ .m\:aic { align-items: center }
143
+ .m\:aife { align-items: flex-end }
144
+
145
+ .m\:jcfs { justify-content: flex-start }
146
+ .m\:jcc { justify-content: center }
147
+ .m\:jcfe { justify-content: flex-end }
148
+ .m\:jcsb { justify-content: space-between }
149
+ .m\:jcsa { justify-content: space-around }
150
+ .m\:jcse { justify-content: space-evenly }
151
+
152
+ .m\:no-shrink { flex-shrink: 0 }
153
+ .m\:no-grow { flex-grow: 0 }
154
+ }
164
155
 
165
- .l\:jcfs { justify-content: flex-start }
166
- .l\:jcc { justify-content: center }
167
- .l\:jcfe { justify-content: flex-end }
168
- .l\:jcsb { justify-content: space-between }
169
- .l\:jcsa { justify-content: space-around }
170
- .l\:jcse { justify-content: space-evenly }
156
+ @media (min-width: 1024px) {
157
+ .l\:fr { flex-direction: row }
158
+ .l\:fc { flex-direction: column }
159
+ .l\:fw { flex-wrap: wrap }
160
+ .l\:fnw { flex-wrap: nowrap }
161
+
162
+ .l\:ais { align-items: stretch }
163
+ .l\:aifs { align-items: flex-start }
164
+ .l\:aic { align-items: center }
165
+ .l\:aife { align-items: flex-end }
166
+
167
+ .l\:jcfs { justify-content: flex-start }
168
+ .l\:jcc { justify-content: center }
169
+ .l\:jcfe { justify-content: flex-end }
170
+ .l\:jcsb { justify-content: space-between }
171
+ .l\:jcsa { justify-content: space-around }
172
+ .l\:jcse { justify-content: space-evenly }
173
+
174
+ .l\:no-shrink { flex-shrink: 0 }
175
+ .l\:no-grow { flex-grow: 0 }
176
+ }
171
177
 
172
- .l\:no-shrink { flex-shrink: 0 }
173
- .l\:no-grow { flex-grow: 0 }
174
- }
178
+ @media (min-width: 1280px) {
179
+ .xl\:fr { flex-direction: row }
180
+ .xl\:fc { flex-direction: column }
181
+ .xl\:fw { flex-wrap: wrap }
182
+ .xl\:fnw { flex-wrap: nowrap }
183
+
184
+ .xl\:ais { align-items: stretch }
185
+ .xl\:aifs { align-items: flex-start }
186
+ .xl\:aic { align-items: center }
187
+ .xl\:aife { align-items: flex-end }
188
+
189
+ .xl\:jcfs { justify-content: flex-start }
190
+ .xl\:jcc { justify-content: center }
191
+ .xl\:jcfe { justify-content: flex-end }
192
+ .xl\:jcsb { justify-content: space-between }
193
+ .xl\:jcsa { justify-content: space-around }
194
+ .xl\:jcse { justify-content: space-evenly }
195
+
196
+ .xl\:no-shrink { flex-shrink: 0 }
197
+ .xl\:no-grow { flex-grow: 0 }
198
+ }
175
199
 
176
- @media (min-width: 1280px) {
177
- .xl\:fr { flex-direction: row }
178
- .xl\:fc { flex-direction: column }
179
- .xl\:fw { flex-wrap: wrap }
180
- .xl\:fnw { flex-wrap: nowrap }
181
-
182
- .xl\:ais { align-items: stretch }
183
- .xl\:aifs { align-items: flex-start }
184
- .xl\:aic { align-items: center }
185
- .xl\:aife { align-items: flex-end }
186
-
187
- .xl\:jcfs { justify-content: flex-start }
188
- .xl\:jcc { justify-content: center }
189
- .xl\:jcfe { justify-content: flex-end }
190
- .xl\:jcsb { justify-content: space-between }
191
- .xl\:jcsa { justify-content: space-around }
192
- .xl\:jcse { justify-content: space-evenly }
193
-
194
- .xl\:no-shrink { flex-shrink: 0 }
195
- .xl\:no-grow { flex-grow: 0 }
196
200
  }
@@ -11,47 +11,51 @@ All right reserved.
11
11
  .flow.s[0-10] (s,m,l,xl) - vertical space
12
12
  */
13
13
 
14
- .flow {
14
+ @layer flow {
15
15
 
16
- & > * { margin: 0 }
17
-
18
- @for $i from 0 to 10 {
19
- &.s$(i) > * {
20
- margin-bottom: var(--space-$(i));
21
- }
22
- }
23
-
24
- @media (min-width: 640px) {
16
+ .flow {
17
+
18
+ & > * { margin: 0 }
19
+
25
20
  @for $i from 0 to 10 {
26
- &.s\:s$(i) > * {
21
+ &.s$(i) > * {
27
22
  margin-bottom: var(--space-$(i));
28
23
  }
29
24
  }
30
- }
31
-
32
- @media (min-width: 768px) {
33
- @for $i from 0 to 10 {
34
- &.m\:s$(i) > * {
35
- margin-bottom: var(--space-$(i));
25
+
26
+ @media (min-width: 640px) {
27
+ @for $i from 0 to 10 {
28
+ &.s\:s$(i) > * {
29
+ margin-bottom: var(--space-$(i));
30
+ }
36
31
  }
37
32
  }
38
- }
39
-
40
- @media (min-width: 1024px) {
41
- @for $i from 0 to 10 {
42
- &.l\:s$(i) > * {
43
- margin-bottom: var(--space-$(i));
33
+
34
+ @media (min-width: 768px) {
35
+ @for $i from 0 to 10 {
36
+ &.m\:s$(i) > * {
37
+ margin-bottom: var(--space-$(i));
38
+ }
44
39
  }
45
40
  }
46
- }
47
-
48
- @media (min-width: 1280px) {
49
- @for $i from 0 to 10 {
50
- &.xl\:s$(i) > * {
51
- margin-bottom: var(--space-$(i));
41
+
42
+ @media (min-width: 1024px) {
43
+ @for $i from 0 to 10 {
44
+ &.l\:s$(i) > * {
45
+ margin-bottom: var(--space-$(i));
46
+ }
47
+ }
48
+ }
49
+
50
+ @media (min-width: 1280px) {
51
+ @for $i from 0 to 10 {
52
+ &.xl\:s$(i) > * {
53
+ margin-bottom: var(--space-$(i));
54
+ }
52
55
  }
53
56
  }
57
+
58
+ & > *:last-child { margin-bottom: 0 }
54
59
  }
55
-
56
- & > *:last-child { margin-bottom: 0 }
60
+
57
61
  }