Skip to content

Commit ef99cec

Browse files
committed
feat(styles/components): icon button styles
1 parent f6d7a08 commit ef99cec

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@layer components {
2+
.gecut-icon-button {
3+
&.filled {
4+
@apply text-onPrimary bg-primary state-onPrimary disabled:opacity-15;
5+
}
6+
&.filled-tonal {
7+
@apply text-onSecondaryContainer bg-secondaryContainer state-onSecondaryContainer disabled:opacity-25;
8+
}
9+
&.outlined {
10+
@apply text-primary bg-transparent border border-outline state-primary disabled:opacity-45;
11+
}
12+
&.normal {
13+
@apply text-primary bg-transparent state-primary disabled:opacity-60;
14+
}
15+
16+
&.toggle {
17+
&:has(:checked) {
18+
&.outlined {
19+
@apply text-inverseOnSurface bg-inverseSurface state-inverseOnSurface border-inverseSurface;
20+
}
21+
22+
.gecut-icon-button-unselected-icon {
23+
@apply opacity-0;
24+
}
25+
.gecut-icon-button-selected-icon {
26+
@apply opacity-100;
27+
}
28+
}
29+
&:not(:has(:checked)) {
30+
&.filled {
31+
@apply text-primary bg-surfaceVariant state-primary;
32+
}
33+
&.filled-tonal {
34+
@apply bg-surfaceContainerHighest state-onSurfaceVariant;
35+
}
36+
&.outlined {
37+
@apply text-onSurfaceVariant state-onSurfaceVariant;
38+
}
39+
&.normal {
40+
@apply text-onSurfaceVariant state-onSurfaceVariant;
41+
}
42+
}
43+
44+
@apply transition-colors duration-300;
45+
}
46+
47+
& &-loader {
48+
@apply absolute inset-0 z-[2] flex justify-center items-center transition-opacity duration-300 opacity-0;
49+
}
50+
51+
& &-icon {
52+
@apply transition-opacity duration-300;
53+
}
54+
55+
& &-unselected-icon {
56+
@apply opacity-100;
57+
}
58+
& &-selected-icon {
59+
@apply absolute inset-0 z-[3] flex justify-center items-center opacity-0;
60+
}
61+
62+
&[loading] {
63+
.gecut-icon-button-loader {
64+
@apply opacity-100;
65+
}
66+
67+
.gecut-icon-button-icon {
68+
@apply opacity-0;
69+
}
70+
71+
@apply cursor-default pointer-events-none;
72+
}
73+
74+
@apply relative shrink-0 focus-ring m-1 flex h-10 w-10 items-center justify-center rounded-full cursor-pointer disabled:cursor-default disabled:pointer-events-none;
75+
}
76+
}

0 commit comments

Comments
 (0)