zenkit-css 1.0.8 → 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,446 @@
1
+ // ========================================
2
+ // ZenKit - Icon Button Component
3
+ // ========================================
4
+
5
+ @use '../abstracts/variables' as *;
6
+
7
+ // ----------------------------------------
8
+ // Icon Button Base
9
+ // ----------------------------------------
10
+ .icon-btn {
11
+ display: inline-flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ width: 2.5rem;
15
+ height: 2.5rem;
16
+ padding: 0;
17
+ font-size: 1.25rem;
18
+ color: var(--text);
19
+ background-color: transparent;
20
+ border: none;
21
+ border-radius: $border-radius;
22
+ cursor: pointer;
23
+ transition: all $transition-fast $transition-timing;
24
+ -webkit-tap-highlight-color: transparent;
25
+
26
+ &:hover {
27
+ background-color: var(--gray-100);
28
+ }
29
+
30
+ &:focus {
31
+ outline: none;
32
+ box-shadow: 0 0 0 2px var(--primary-200);
33
+ }
34
+
35
+ &:active {
36
+ transform: scale(0.95);
37
+ }
38
+
39
+ &:disabled {
40
+ opacity: 0.5;
41
+ cursor: not-allowed;
42
+ pointer-events: none;
43
+ }
44
+
45
+ svg {
46
+ width: 1em;
47
+ height: 1em;
48
+ }
49
+ }
50
+
51
+ // ----------------------------------------
52
+ // Icon Button Sizes
53
+ // ----------------------------------------
54
+ .icon-btn-xs {
55
+ width: 1.5rem;
56
+ height: 1.5rem;
57
+ font-size: 0.75rem;
58
+ }
59
+
60
+ .icon-btn-sm {
61
+ width: 2rem;
62
+ height: 2rem;
63
+ font-size: 1rem;
64
+ }
65
+
66
+ .icon-btn-md {
67
+ width: 2.5rem;
68
+ height: 2.5rem;
69
+ font-size: 1.25rem;
70
+ }
71
+
72
+ .icon-btn-lg {
73
+ width: 3rem;
74
+ height: 3rem;
75
+ font-size: 1.5rem;
76
+ }
77
+
78
+ .icon-btn-xl {
79
+ width: 3.5rem;
80
+ height: 3.5rem;
81
+ font-size: 1.75rem;
82
+ }
83
+
84
+ // ----------------------------------------
85
+ // Icon Button Variants
86
+ // ----------------------------------------
87
+
88
+ // Filled
89
+ .icon-btn-filled {
90
+ background-color: var(--gray-100);
91
+
92
+ &:hover {
93
+ background-color: var(--gray-200);
94
+ }
95
+ }
96
+
97
+ // Outlined
98
+ .icon-btn-outlined {
99
+ border: 1px solid var(--border);
100
+
101
+ &:hover {
102
+ background-color: var(--gray-50);
103
+ border-color: var(--gray-400);
104
+ }
105
+ }
106
+
107
+ // Ghost (no background until hover)
108
+ .icon-btn-ghost {
109
+ background-color: transparent;
110
+
111
+ &:hover {
112
+ background-color: var(--gray-100);
113
+ }
114
+ }
115
+
116
+ // Light
117
+ .icon-btn-light {
118
+ background-color: var(--gray-50);
119
+
120
+ &:hover {
121
+ background-color: var(--gray-100);
122
+ }
123
+ }
124
+
125
+ // ----------------------------------------
126
+ // Icon Button Colors
127
+ // ----------------------------------------
128
+ .icon-btn-primary {
129
+ color: var(--primary);
130
+
131
+ &:hover {
132
+ background-color: var(--primary-50);
133
+ }
134
+
135
+ &.icon-btn-filled {
136
+ background-color: var(--primary);
137
+ color: var(--white);
138
+
139
+ &:hover {
140
+ background-color: var(--primary-600);
141
+ }
142
+ }
143
+
144
+ &.icon-btn-outlined {
145
+ border-color: var(--primary);
146
+
147
+ &:hover {
148
+ background-color: var(--primary-50);
149
+ }
150
+ }
151
+ }
152
+
153
+ .icon-btn-secondary {
154
+ color: var(--gray-600);
155
+
156
+ &:hover {
157
+ background-color: var(--gray-100);
158
+ }
159
+
160
+ &.icon-btn-filled {
161
+ background-color: var(--gray-600);
162
+ color: var(--white);
163
+
164
+ &:hover {
165
+ background-color: var(--gray-700);
166
+ }
167
+ }
168
+ }
169
+
170
+ .icon-btn-success {
171
+ color: var(--success);
172
+
173
+ &:hover {
174
+ background-color: var(--success-50);
175
+ }
176
+
177
+ &.icon-btn-filled {
178
+ background-color: var(--success);
179
+ color: var(--white);
180
+
181
+ &:hover {
182
+ background-color: var(--success-600);
183
+ }
184
+ }
185
+ }
186
+
187
+ .icon-btn-danger {
188
+ color: var(--danger);
189
+
190
+ &:hover {
191
+ background-color: var(--danger-50);
192
+ }
193
+
194
+ &.icon-btn-filled {
195
+ background-color: var(--danger);
196
+ color: var(--white);
197
+
198
+ &:hover {
199
+ background-color: var(--danger-600);
200
+ }
201
+ }
202
+ }
203
+
204
+ .icon-btn-warning {
205
+ color: var(--warning);
206
+
207
+ &:hover {
208
+ background-color: var(--warning-50);
209
+ }
210
+
211
+ &.icon-btn-filled {
212
+ background-color: var(--warning);
213
+ color: var(--gray-900);
214
+
215
+ &:hover {
216
+ background-color: var(--warning-600);
217
+ }
218
+ }
219
+ }
220
+
221
+ .icon-btn-info {
222
+ color: var(--info);
223
+
224
+ &:hover {
225
+ background-color: var(--info-50);
226
+ }
227
+
228
+ &.icon-btn-filled {
229
+ background-color: var(--info);
230
+ color: var(--white);
231
+
232
+ &:hover {
233
+ background-color: var(--info-600);
234
+ }
235
+ }
236
+ }
237
+
238
+ // ----------------------------------------
239
+ // Icon Button Shapes
240
+ // ----------------------------------------
241
+ .icon-btn-rounded {
242
+ border-radius: $border-radius-full;
243
+ }
244
+
245
+ .icon-btn-square {
246
+ border-radius: 0;
247
+ }
248
+
249
+ // ----------------------------------------
250
+ // Icon Button Loading
251
+ // ----------------------------------------
252
+ .icon-btn-loading {
253
+ position: relative;
254
+ pointer-events: none;
255
+
256
+ svg {
257
+ opacity: 0;
258
+ }
259
+
260
+ &::after {
261
+ content: "";
262
+ position: absolute;
263
+ width: 1em;
264
+ height: 1em;
265
+ border: 2px solid currentColor;
266
+ border-top-color: transparent;
267
+ border-radius: 50%;
268
+ animation: icon-btn-spin 0.6s linear infinite;
269
+ }
270
+ }
271
+
272
+ @keyframes icon-btn-spin {
273
+ to {
274
+ transform: rotate(360deg);
275
+ }
276
+ }
277
+
278
+ // ----------------------------------------
279
+ // Icon Button with Tooltip
280
+ // ----------------------------------------
281
+ .icon-btn-tooltip {
282
+ position: relative;
283
+
284
+ &::before {
285
+ content: attr(data-tooltip);
286
+ position: absolute;
287
+ bottom: calc(100% + 8px);
288
+ left: 50%;
289
+ transform: translateX(-50%);
290
+ padding: 0.375rem 0.625rem;
291
+ font-size: var(--text-xs);
292
+ font-weight: $font-weight-medium;
293
+ color: var(--white);
294
+ background-color: var(--gray-900);
295
+ border-radius: $border-radius;
296
+ white-space: nowrap;
297
+ opacity: 0;
298
+ visibility: hidden;
299
+ transition: opacity $transition-fast $transition-timing;
300
+ pointer-events: none;
301
+ z-index: 100;
302
+ }
303
+
304
+ &::after {
305
+ content: "";
306
+ position: absolute;
307
+ bottom: calc(100% + 4px);
308
+ left: 50%;
309
+ transform: translateX(-50%);
310
+ border: 4px solid transparent;
311
+ border-top-color: var(--gray-900);
312
+ opacity: 0;
313
+ visibility: hidden;
314
+ transition: opacity $transition-fast $transition-timing;
315
+ }
316
+
317
+ &:hover::before,
318
+ &:hover::after {
319
+ opacity: 1;
320
+ visibility: visible;
321
+ }
322
+ }
323
+
324
+ // ----------------------------------------
325
+ // Icon Button Group
326
+ // ----------------------------------------
327
+ .icon-btn-group {
328
+ display: inline-flex;
329
+
330
+ .icon-btn {
331
+ border-radius: 0;
332
+
333
+ &:first-child {
334
+ border-radius: $border-radius 0 0 $border-radius;
335
+ }
336
+
337
+ &:last-child {
338
+ border-radius: 0 $border-radius $border-radius 0;
339
+ }
340
+
341
+ &:not(:last-child) {
342
+ border-right: 1px solid var(--border);
343
+ }
344
+ }
345
+
346
+ &.icon-btn-group-rounded .icon-btn {
347
+ &:first-child {
348
+ border-radius: $border-radius-full 0 0 $border-radius-full;
349
+ }
350
+
351
+ &:last-child {
352
+ border-radius: 0 $border-radius-full $border-radius-full 0;
353
+ }
354
+ }
355
+ }
356
+
357
+ // Vertical group
358
+ .icon-btn-group-vertical {
359
+ flex-direction: column;
360
+
361
+ .icon-btn {
362
+ border-radius: 0;
363
+
364
+ &:first-child {
365
+ border-radius: $border-radius $border-radius 0 0;
366
+ }
367
+
368
+ &:last-child {
369
+ border-radius: 0 0 $border-radius $border-radius;
370
+ }
371
+
372
+ &:not(:last-child) {
373
+ border-right: none;
374
+ border-bottom: 1px solid var(--border);
375
+ }
376
+ }
377
+ }
378
+
379
+ // ----------------------------------------
380
+ // Dark Mode
381
+ // ----------------------------------------
382
+ [data-theme="dark"] {
383
+ .icon-btn {
384
+ color: var(--gray-300);
385
+
386
+ &:hover {
387
+ background-color: var(--gray-800);
388
+ }
389
+ }
390
+
391
+ .icon-btn-filled {
392
+ background-color: var(--gray-800);
393
+
394
+ &:hover {
395
+ background-color: var(--gray-700);
396
+ }
397
+ }
398
+
399
+ .icon-btn-outlined {
400
+ border-color: var(--gray-600);
401
+
402
+ &:hover {
403
+ background-color: var(--gray-800);
404
+ }
405
+ }
406
+
407
+ .icon-btn-light {
408
+ background-color: var(--gray-800);
409
+
410
+ &:hover {
411
+ background-color: var(--gray-700);
412
+ }
413
+ }
414
+
415
+ .icon-btn-primary:hover {
416
+ background-color: rgba($primary, 0.2);
417
+ }
418
+
419
+ .icon-btn-success:hover {
420
+ background-color: rgba($success, 0.2);
421
+ }
422
+
423
+ .icon-btn-danger:hover {
424
+ background-color: rgba($danger, 0.2);
425
+ }
426
+
427
+ .icon-btn-warning:hover {
428
+ background-color: rgba($warning, 0.2);
429
+ }
430
+
431
+ .icon-btn-info:hover {
432
+ background-color: rgba($info, 0.2);
433
+ }
434
+
435
+ .icon-btn-tooltip::before {
436
+ background-color: var(--gray-700);
437
+ }
438
+
439
+ .icon-btn-tooltip::after {
440
+ border-top-color: var(--gray-700);
441
+ }
442
+
443
+ .icon-btn-group .icon-btn:not(:last-child) {
444
+ border-color: var(--gray-700);
445
+ }
446
+ }