diff options
Diffstat (limited to 'src/objects/_tabbar.scss')
-rw-r--r-- | src/objects/_tabbar.scss | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/src/objects/_tabbar.scss b/src/objects/_tabbar.scss new file mode 100644 index 0000000..80fac0b --- /dev/null +++ b/src/objects/_tabbar.scss | |||
@@ -0,0 +1,114 @@ | |||
1 | @use 'sass:map'; | ||
2 | @use 'sass:meta'; | ||
3 | @use 'sass:string'; | ||
4 | @use 'iro-sass/src/bem'; | ||
5 | @use 'iro-sass/src/props'; | ||
6 | @use '../props' as *; | ||
7 | |||
8 | @forward 'tabs.vars'; | ||
9 | @use 'tabs.vars' as vars; | ||
10 | |||
11 | @mixin styles { | ||
12 | @include materialize-at-root(meta.module-variables('vars')); | ||
13 | |||
14 | @include bem.object('tabs') { | ||
15 | position: relative; | ||
16 | display: flex; | ||
17 | gap: props.get(vars.$spacing); | ||
18 | min-inline-size: 0; | ||
19 | block-size: props.get(vars.$block-size); | ||
20 | overflow-inline: auto; | ||
21 | box-shadow: 0 calc(-1 * props.get(vars.$indicator--width)) 0 0 props.get(vars.$railing--bg-color) inset; | ||
22 | |||
23 | @include bem.modifier('quiet') { | ||
24 | box-shadow: none; | ||
25 | } | ||
26 | |||
27 | @include bem.modifier('adapt') { | ||
28 | block-size: 100%; | ||
29 | } | ||
30 | |||
31 | @include bem.elem('tab') { | ||
32 | position: relative; | ||
33 | display: flex; | ||
34 | align-items: center; | ||
35 | color: props.get(vars.$tab--text-color); | ||
36 | white-space: nowrap; | ||
37 | border-block: props.get(vars.$indicator--width) solid transparent; | ||
38 | |||
39 | &::before { | ||
40 | position: absolute; | ||
41 | inset-block-start: 50%; | ||
42 | inset-inline: calc(-1 * props.get(vars.$tab--pad-i)); | ||
43 | z-index: -10; | ||
44 | block-size: 1.5em; | ||
45 | content: ''; | ||
46 | border-radius: props.get(vars.$rounding); | ||
47 | transform: translateY(-50%); | ||
48 | } | ||
49 | |||
50 | &:link, | ||
51 | &:visited { | ||
52 | &:hover, | ||
53 | &:active, | ||
54 | &:focus-visible { | ||
55 | color: props.get(vars.$tab--selected--text-color); | ||
56 | } | ||
57 | |||
58 | &:focus-visible { | ||
59 | &::before { | ||
60 | color: props.get(vars.$key-focus--text-color); | ||
61 | text-decoration: none; | ||
62 | outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); | ||
63 | box-shadow: 0 0 0 | ||
64 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | ||
65 | props.get(vars.$key-focus--outline-color); | ||
66 | } | ||
67 | } | ||
68 | } | ||
69 | |||
70 | @include bem.is('selected') { | ||
71 | color: props.get(vars.$tab--selected--text-color); | ||
72 | border-block-end-color: props.get(vars.$tab--selected--text-color); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | @include bem.elem('caret') { | ||
77 | display: none; | ||
78 | } | ||
79 | |||
80 | @include bem.modifier('accent') { | ||
81 | @include bem.elem('tab') { | ||
82 | @include bem.is('selected') { | ||
83 | color: props.get(vars.$tab--accent--text-color); | ||
84 | border-block-end-color: props.get(vars.$tab--accent--text-color); | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @include bem.is('collapsed') { | ||
90 | @include bem.elem('tab') { | ||
91 | display: none; | ||
92 | |||
93 | @include bem.is('selected') { | ||
94 | display: flex; | ||
95 | color: props.get(vars.$tab--text-color); | ||
96 | border-block-end-color: transparent; | ||
97 | |||
98 | &:link, | ||
99 | &:visited { | ||
100 | &:hover, | ||
101 | &:active, | ||
102 | &:focus-visible { | ||
103 | color: props.get(vars.$tab--selected--text-color); | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | } | ||
108 | |||
109 | @include bem.elem('caret') { | ||
110 | display: block; | ||
111 | } | ||
112 | } | ||
113 | } | ||
114 | } | ||