diff options
author | Volpeon <git@volpeon.ink> | 2024-11-17 15:51:24 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-11-17 15:51:24 +0100 |
commit | 4ef7ba48a68980c126b89bf5ba5a9ddac804f88f (patch) | |
tree | d0351997b3823d13c0cc94e717420dedecd6d65d /src/objects/_navbar.scss | |
parent | Fix heading color (diff) | |
download | iro-design-4ef7ba48a68980c126b89bf5ba5a9ddac804f88f.tar.gz iro-design-4ef7ba48a68980c126b89bf5ba5a9ddac804f88f.tar.bz2 iro-design-4ef7ba48a68980c126b89bf5ba5a9ddac804f88f.zip |
Add navbar
Diffstat (limited to 'src/objects/_navbar.scss')
-rw-r--r-- | src/objects/_navbar.scss | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/src/objects/_navbar.scss b/src/objects/_navbar.scss new file mode 100644 index 0000000..16cf804 --- /dev/null +++ b/src/objects/_navbar.scss | |||
@@ -0,0 +1,165 @@ | |||
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 'navbar.vars'; | ||
9 | @use 'navbar.vars' as vars; | ||
10 | |||
11 | @mixin styles { | ||
12 | @include materialize-at-root(meta.module-variables('vars')); | ||
13 | |||
14 | @include bem.object('navbar') { | ||
15 | display: flex; | ||
16 | block-size: props.get(vars.$block-size); | ||
17 | |||
18 | @include bem.modifier('adapt') { | ||
19 | block-size: 100%; | ||
20 | } | ||
21 | |||
22 | @include bem.elem('item-label') { | ||
23 | position: relative; | ||
24 | padding-block: props.get(vars.$item--pad-b); | ||
25 | padding-inline: props.get(vars.$item--pad-i); | ||
26 | font-size: props.get(vars.$item--font-size); | ||
27 | color: currentColor; | ||
28 | border-radius: 100em; | ||
29 | |||
30 | &::after { | ||
31 | position: absolute; | ||
32 | inset: calc(-1 * props.get(vars.$key-focus--border-offset)); | ||
33 | z-index: 1; | ||
34 | display: none; | ||
35 | pointer-events: none; | ||
36 | content: ''; | ||
37 | border-radius: 100em; | ||
38 | outline: props.get(vars.$default-theme, --key-focus, --border) solid props.get(vars.$key-focus--border-width); | ||
39 | box-shadow: | ||
40 | 0 | ||
41 | 0 | ||
42 | 0 | ||
43 | calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) | ||
44 | props.get(vars.$default-theme, --key-focus, --outline); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | @include bem.elem('item') { | ||
49 | display: flex; | ||
50 | flex-direction: column; | ||
51 | align-items: center; | ||
52 | justify-content: center; | ||
53 | inline-size: 100%; | ||
54 | padding-inline: calc(.5 * props.get(vars.$spacing)); | ||
55 | font-weight: 500; | ||
56 | color: props.get(vars.$default-theme, --disabled, --label-color); | ||
57 | |||
58 | &:link, | ||
59 | &:visited, | ||
60 | &:enabled { | ||
61 | color: props.get(vars.$default-theme, --label-color); | ||
62 | |||
63 | &:hover, | ||
64 | &:focus-visible { | ||
65 | color: props.get(vars.$default-theme, --hover, --label-color); | ||
66 | |||
67 | @include bem.elem('item-label') { | ||
68 | background-color: props.get(vars.$default-theme, --hover, --bg-color); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | &:focus-visible { | ||
73 | @include bem.elem('item-label') { | ||
74 | &::after { | ||
75 | display: block; | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
80 | &:active { | ||
81 | color: props.get(vars.$default-theme, --active, --label-color); | ||
82 | |||
83 | @include bem.elem('item-label') { | ||
84 | background-color: props.get(vars.$default-theme, --active, --bg-color); | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | |||
89 | @include bem.is('selected') { | ||
90 | font-weight: bold; | ||
91 | color: props.get(vars.$default-theme, --selected, --disabled, --label-color); | ||
92 | |||
93 | @include bem.elem('item-label') { | ||
94 | background-color: props.get(vars.$default-theme, --selected, --disabled, --bg-color); | ||
95 | } | ||
96 | |||
97 | &:link, | ||
98 | &:visited, | ||
99 | &:enabled { | ||
100 | color: props.get(vars.$default-theme, --selected, --label-color); | ||
101 | |||
102 | @include bem.elem('item-label') { | ||
103 | background-color: props.get(vars.$default-theme, --selected, --bg-color); | ||
104 | } | ||
105 | |||
106 | &:hover, | ||
107 | &:focus-visible { | ||
108 | color: props.get(vars.$default-theme, --selected, --hover, --label-color); | ||
109 | |||
110 | @include bem.elem('item-label') { | ||
111 | background-color: props.get(vars.$default-theme, --selected, --hover, --bg-color); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | &:active { | ||
116 | color: props.get(vars.$default-theme, --selected, --active, --label-color); | ||
117 | |||
118 | @include bem.elem('item-label') { | ||
119 | background-color: props.get(vars.$default-theme, --selected, --active, --bg-color); | ||
120 | } | ||
121 | } | ||
122 | } | ||
123 | } | ||
124 | } | ||
125 | |||
126 | @include bem.modifier('quiet') { | ||
127 | @include bem.elem('item') { | ||
128 | @include bem.is('selected') { | ||
129 | color: props.get(vars.$default-theme, --quiet, --selected, --disabled, --label-color); | ||
130 | |||
131 | @include bem.elem('item-label') { | ||
132 | background-color: props.get(vars.$default-theme, --quiet, --selected, --disabled, --bg-color); | ||
133 | } | ||
134 | |||
135 | &:link, | ||
136 | &:visited, | ||
137 | &:enabled { | ||
138 | color: props.get(vars.$default-theme, --quiet, --selected, --label-color); | ||
139 | |||
140 | @include bem.elem('item-label') { | ||
141 | background-color: props.get(vars.$default-theme, --quiet, --selected, --bg-color); | ||
142 | } | ||
143 | |||
144 | &:hover, | ||
145 | &:focus-visible { | ||
146 | color: props.get(vars.$default-theme, --quiet, --selected, --hover, --label-color); | ||
147 | |||
148 | @include bem.elem('item-label') { | ||
149 | background-color: props.get(vars.$default-theme, --quiet, --selected, --hover, --bg-color); | ||
150 | } | ||
151 | } | ||
152 | |||
153 | &:active { | ||
154 | color: props.get(vars.$default-theme, --quiet, --selected, --active, --label-color); | ||
155 | |||
156 | @include bem.elem('item-label') { | ||
157 | background-color: props.get(vars.$default-theme, --quiet, --selected, --active, --bg-color); | ||
158 | } | ||
159 | } | ||
160 | } | ||
161 | } | ||
162 | } | ||
163 | } | ||
164 | } | ||
165 | } | ||