zenkit-css 1.0.7 → 1.2.0

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.
@@ -0,0 +1,352 @@
1
+ // ========================================
2
+ // ZenKit - Button Group Component
3
+ // ========================================
4
+
5
+ @use '../abstracts/variables' as *;
6
+
7
+ // ----------------------------------------
8
+ // Button Group Base
9
+ // ----------------------------------------
10
+ .btn-group {
11
+ display: inline-flex;
12
+ position: relative;
13
+ vertical-align: middle;
14
+
15
+ > .btn {
16
+ position: relative;
17
+ flex: 0 1 auto;
18
+ border-radius: 0;
19
+
20
+ &:first-child {
21
+ border-top-left-radius: $border-radius;
22
+ border-bottom-left-radius: $border-radius;
23
+ }
24
+
25
+ &:last-child {
26
+ border-top-right-radius: $border-radius;
27
+ border-bottom-right-radius: $border-radius;
28
+ }
29
+
30
+ &:not(:first-child) {
31
+ margin-left: -1px;
32
+ }
33
+
34
+ &:hover,
35
+ &:focus,
36
+ &:active,
37
+ &.active {
38
+ z-index: 1;
39
+ }
40
+ }
41
+ }
42
+
43
+ // ----------------------------------------
44
+ // Button Group Vertical
45
+ // ----------------------------------------
46
+ .btn-group-vertical {
47
+ flex-direction: column;
48
+ align-items: flex-start;
49
+
50
+ > .btn {
51
+ width: 100%;
52
+ border-radius: 0;
53
+
54
+ &:first-child {
55
+ border-top-left-radius: $border-radius;
56
+ border-top-right-radius: $border-radius;
57
+ border-bottom-left-radius: 0;
58
+ }
59
+
60
+ &:last-child {
61
+ border-bottom-left-radius: $border-radius;
62
+ border-bottom-right-radius: $border-radius;
63
+ border-top-right-radius: 0;
64
+ }
65
+
66
+ &:not(:first-child) {
67
+ margin-left: 0;
68
+ margin-top: -1px;
69
+ }
70
+ }
71
+ }
72
+
73
+ // ----------------------------------------
74
+ // Button Group Sizes
75
+ // ----------------------------------------
76
+ .btn-group-sm > .btn {
77
+ padding: 0.375rem 0.75rem;
78
+ font-size: var(--text-sm);
79
+ }
80
+
81
+ .btn-group-lg > .btn {
82
+ padding: 0.625rem 1.25rem;
83
+ font-size: var(--text-lg);
84
+ }
85
+
86
+ // ----------------------------------------
87
+ // Button Group Connected (no gaps)
88
+ // ----------------------------------------
89
+ .btn-group-connected {
90
+ > .btn {
91
+ border-right-width: 0;
92
+
93
+ &:last-child {
94
+ border-right-width: 1px;
95
+ }
96
+ }
97
+
98
+ &.btn-group-vertical > .btn {
99
+ border-right-width: 1px;
100
+ border-bottom-width: 0;
101
+
102
+ &:last-child {
103
+ border-bottom-width: 1px;
104
+ }
105
+ }
106
+ }
107
+
108
+ // ----------------------------------------
109
+ // Button Group Spaced
110
+ // ----------------------------------------
111
+ .btn-group-spaced {
112
+ gap: 0.5rem;
113
+
114
+ > .btn {
115
+ border-radius: $border-radius;
116
+ margin-left: 0;
117
+
118
+ &:not(:first-child) {
119
+ margin-left: 0;
120
+ }
121
+ }
122
+ }
123
+
124
+ .btn-group-spaced-sm {
125
+ gap: 0.25rem;
126
+ }
127
+
128
+ .btn-group-spaced-lg {
129
+ gap: 0.75rem;
130
+ }
131
+
132
+ // ----------------------------------------
133
+ // Button Group Full Width
134
+ // ----------------------------------------
135
+ .btn-group-full {
136
+ display: flex;
137
+ width: 100%;
138
+
139
+ > .btn {
140
+ flex: 1;
141
+ }
142
+ }
143
+
144
+ // ----------------------------------------
145
+ // Button Group with Divider
146
+ // ----------------------------------------
147
+ .btn-group-divided {
148
+ > .btn:not(:last-child)::after {
149
+ content: "";
150
+ position: absolute;
151
+ top: 25%;
152
+ right: 0;
153
+ height: 50%;
154
+ width: 1px;
155
+ background-color: rgba(0, 0, 0, 0.1);
156
+ }
157
+
158
+ &.btn-group-vertical > .btn:not(:last-child)::after {
159
+ top: auto;
160
+ bottom: 0;
161
+ right: 25%;
162
+ height: 1px;
163
+ width: 50%;
164
+ }
165
+ }
166
+
167
+ // ----------------------------------------
168
+ // Button Group Rounded
169
+ // ----------------------------------------
170
+ .btn-group-rounded {
171
+ > .btn {
172
+ &:first-child {
173
+ border-top-left-radius: $border-radius-full;
174
+ border-bottom-left-radius: $border-radius-full;
175
+ }
176
+
177
+ &:last-child {
178
+ border-top-right-radius: $border-radius-full;
179
+ border-bottom-right-radius: $border-radius-full;
180
+ }
181
+ }
182
+ }
183
+
184
+ // ----------------------------------------
185
+ // Button Group Toggle
186
+ // ----------------------------------------
187
+ .btn-group-toggle {
188
+ > .btn {
189
+ cursor: pointer;
190
+ user-select: none;
191
+
192
+ &.active {
193
+ background-color: var(--primary);
194
+ border-color: var(--primary);
195
+ color: var(--white);
196
+ z-index: 2;
197
+ }
198
+
199
+ input[type="radio"],
200
+ input[type="checkbox"] {
201
+ position: absolute;
202
+ opacity: 0;
203
+ pointer-events: none;
204
+ }
205
+ }
206
+ }
207
+
208
+ // ----------------------------------------
209
+ // Button Group Segmented
210
+ // ----------------------------------------
211
+ .btn-group-segmented {
212
+ padding: 0.25rem;
213
+ background-color: var(--gray-100);
214
+ border-radius: $border-radius-lg;
215
+
216
+ > .btn {
217
+ background-color: transparent;
218
+ border: none;
219
+ color: var(--text-muted);
220
+ font-weight: $font-weight-medium;
221
+
222
+ &:hover {
223
+ color: var(--text);
224
+ }
225
+
226
+ &.active {
227
+ background-color: var(--bg);
228
+ color: var(--text);
229
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
230
+ }
231
+
232
+ &:first-child {
233
+ border-radius: $border-radius;
234
+ }
235
+
236
+ &:last-child {
237
+ border-radius: $border-radius;
238
+ }
239
+ }
240
+ }
241
+
242
+ // ----------------------------------------
243
+ // Button Group Colors
244
+ // ----------------------------------------
245
+ .btn-group-primary > .btn {
246
+ &.active {
247
+ background-color: var(--primary);
248
+ border-color: var(--primary);
249
+ color: var(--white);
250
+ }
251
+ }
252
+
253
+ .btn-group-secondary > .btn {
254
+ &.active {
255
+ background-color: var(--gray-600);
256
+ border-color: var(--gray-600);
257
+ color: var(--white);
258
+ }
259
+ }
260
+
261
+ .btn-group-success > .btn {
262
+ &.active {
263
+ background-color: var(--success);
264
+ border-color: var(--success);
265
+ color: var(--white);
266
+ }
267
+ }
268
+
269
+ .btn-group-danger > .btn {
270
+ &.active {
271
+ background-color: var(--danger);
272
+ border-color: var(--danger);
273
+ color: var(--white);
274
+ }
275
+ }
276
+
277
+ // ----------------------------------------
278
+ // Button Toolbar
279
+ // ----------------------------------------
280
+ .btn-toolbar {
281
+ display: flex;
282
+ flex-wrap: wrap;
283
+ gap: 0.5rem;
284
+ }
285
+
286
+ // ----------------------------------------
287
+ // Split Button
288
+ // ----------------------------------------
289
+ .btn-split {
290
+ > .btn:first-child {
291
+ border-top-right-radius: 0;
292
+ border-bottom-right-radius: 0;
293
+ }
294
+
295
+ > .btn-split-toggle {
296
+ padding-left: 0.5rem;
297
+ padding-right: 0.5rem;
298
+ border-top-left-radius: 0;
299
+ border-bottom-left-radius: 0;
300
+ border-left: 1px solid rgba(255, 255, 255, 0.2);
301
+ }
302
+ }
303
+
304
+ // ----------------------------------------
305
+ // Button Group with Dropdown
306
+ // ----------------------------------------
307
+ .btn-group-dropdown {
308
+ position: relative;
309
+
310
+ .dropdown-menu {
311
+ position: absolute;
312
+ top: 100%;
313
+ left: 0;
314
+ z-index: 1000;
315
+ min-width: 10rem;
316
+ margin-top: 0.25rem;
317
+ }
318
+
319
+ &.dropup .dropdown-menu {
320
+ top: auto;
321
+ bottom: 100%;
322
+ margin-top: 0;
323
+ margin-bottom: 0.25rem;
324
+ }
325
+ }
326
+
327
+ // ----------------------------------------
328
+ // Dark Mode
329
+ // ----------------------------------------
330
+ [data-theme="dark"] {
331
+ .btn-group-segmented {
332
+ background-color: var(--gray-800);
333
+
334
+ > .btn {
335
+ color: var(--gray-400);
336
+
337
+ &:hover {
338
+ color: var(--gray-200);
339
+ }
340
+
341
+ &.active {
342
+ background-color: var(--gray-700);
343
+ color: var(--gray-100);
344
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
345
+ }
346
+ }
347
+ }
348
+
349
+ .btn-group-divided > .btn:not(:last-child)::after {
350
+ background-color: rgba(255, 255, 255, 0.1);
351
+ }
352
+ }