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