diff options
author | Volpeon <git@volpeon.ink> | 2024-10-18 18:08:24 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-10-18 18:08:24 +0200 |
commit | 365c56edcc36b5b92902bac01ce44b43d01e8685 (patch) | |
tree | 644611792591a76e605068d0c9e230fad6a633e7 /src/objects/_side-nav.scss | |
parent | Revamped variable management (diff) | |
download | iro-design-365c56edcc36b5b92902bac01ce44b43d01e8685.tar.gz iro-design-365c56edcc36b5b92902bac01ce44b43d01e8685.tar.bz2 iro-design-365c56edcc36b5b92902bac01ce44b43d01e8685.zip |
Refactoring
Diffstat (limited to 'src/objects/_side-nav.scss')
-rw-r--r-- | src/objects/_side-nav.scss | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/src/objects/_side-nav.scss b/src/objects/_side-nav.scss new file mode 100644 index 0000000..237b5aa --- /dev/null +++ b/src/objects/_side-nav.scss | |||
@@ -0,0 +1,122 @@ | |||
1 | @use 'iro-sass/src/iro-sass' as iro; | ||
2 | @use '../functions' as fn; | ||
3 | |||
4 | @use './icon'; | ||
5 | |||
6 | @include iro.props-namespace('side-nav') { | ||
7 | @include iro.props-store(( | ||
8 | --dims: ( | ||
9 | --spacing: fn.global-dim(--size --50), | ||
10 | --header: ( | ||
11 | --font-size: fn.global-dim(--font-size --50), | ||
12 | ), | ||
13 | --separator: fn.global-dim(--size --200), | ||
14 | --item: ( | ||
15 | --pad-i: fn.global-dim(--size --150), | ||
16 | --pad-b: fn.global-dim(--size --100), | ||
17 | --rounding: fn.global-dim(--rounding), | ||
18 | |||
19 | --key-focus: ( | ||
20 | --border: fn.global-dim(--key-focus --border), | ||
21 | --border-offset: fn.global-dim(--key-focus --border-offset), | ||
22 | --outline: fn.global-dim(--key-focus --outline), | ||
23 | ), | ||
24 | ), | ||
25 | ), | ||
26 | --colors: ( | ||
27 | --header: ( | ||
28 | --label: fn.global-color(--text-mute-more), | ||
29 | ), | ||
30 | --item: ( | ||
31 | --hover: ( | ||
32 | --bg: fn.global-color(--border-mute), | ||
33 | --label: fn.global-color(--heading), | ||
34 | ), | ||
35 | --active: ( | ||
36 | --bg: fn.global-color(--border), | ||
37 | --label: fn.global-color(--heading), | ||
38 | ), | ||
39 | --disabled: ( | ||
40 | --label: fn.global-color(--text-disabled), | ||
41 | ), | ||
42 | --key-focus: ( | ||
43 | --border: fn.global-color(--focus --border), | ||
44 | --outline: fn.global-color(--focus --outline), | ||
45 | ), | ||
46 | ), | ||
47 | ), | ||
48 | )); | ||
49 | |||
50 | @include iro.bem-object(iro.props-namespace()) { | ||
51 | display: flex; | ||
52 | flex-direction: column; | ||
53 | gap: fn.dim(--spacing); | ||
54 | |||
55 | @include iro.bem-elem('header') { | ||
56 | padding-block: fn.dim(--item --pad-b); | ||
57 | padding-inline: fn.dim(--item --pad-i); | ||
58 | font-size: fn.dim(--header --font-size); | ||
59 | font-weight: 500; | ||
60 | color: fn.color(--header --label); | ||
61 | text-transform: uppercase; | ||
62 | letter-spacing: .5px; | ||
63 | |||
64 | @include iro.bem-next-twin-elem { | ||
65 | margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); | ||
66 | } | ||
67 | } | ||
68 | |||
69 | @include iro.bem-elem('item') { | ||
70 | padding-block: fn.dim(--item --pad-b); | ||
71 | padding-inline: fn.dim(--item --pad-i); | ||
72 | margin: calc(-1 * fn.dim(--item --key-focus --border-offset)); | ||
73 | color: fn.color(--item --disabled --label); | ||
74 | background-clip: padding-box; | ||
75 | border: fn.dim(--item --key-focus --border-offset) solid transparent; | ||
76 | border-radius: calc(fn.dim(--item --rounding) + fn.dim(--item --key-focus --border-offset)); | ||
77 | |||
78 | &:link, | ||
79 | &:visited, | ||
80 | &:enabled { | ||
81 | color: currentColor; | ||
82 | |||
83 | @include iro.bem-multi('&:hover, &:focus-visible', 'is' 'selected') { | ||
84 | color: fn.color(--item --hover --label); | ||
85 | background-color: fn.color(--item --hover --bg); | ||
86 | } | ||
87 | |||
88 | &:active { | ||
89 | color: fn.color(--item --active --label); | ||
90 | background-color: fn.color(--item --active --bg); | ||
91 | } | ||
92 | |||
93 | &:focus-visible { | ||
94 | outline: fn.color(--item --key-focus --border) solid fn.dim(--item --key-focus --border); | ||
95 | box-shadow: 0 0 0 calc(fn.dim(--item --key-focus --border) + fn.dim(--item --key-focus --outline)) fn.color(--item --key-focus --outline); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | @include iro.bem-next-elem('header') { | ||
100 | margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | @include iro.bem-elem('header') { | ||
105 | &:link, | ||
106 | &:visited, | ||
107 | &:enabled { | ||
108 | color: fn.color(--header --label); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | @include iro.bem-elem('separator') { | ||
113 | block-size: fn.dim(--separator); | ||
114 | } | ||
115 | |||
116 | @include iro.bem-elem('icon-slot') { | ||
117 | display: flex; | ||
118 | justify-content: center; | ||
119 | inline-size: fn.foreign-dim(--icon, --size); | ||
120 | } | ||
121 | } | ||
122 | } | ||