diff options
author | Volpeon <git@volpeon.ink> | 2024-10-19 14:46:06 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-10-19 14:46:06 +0200 |
commit | 3799950b0a869aee0e2725a8aafbb53c26723942 (patch) | |
tree | 9d8ee6ee3e9f963358d6463aa6114d4020a90a39 /src/objects/_menu.scss | |
parent | Update (diff) | |
download | iro-design-3799950b0a869aee0e2725a8aafbb53c26723942.tar.gz iro-design-3799950b0a869aee0e2725a8aafbb53c26723942.tar.bz2 iro-design-3799950b0a869aee0e2725a8aafbb53c26723942.zip |
Update
Diffstat (limited to 'src/objects/_menu.scss')
-rw-r--r-- | src/objects/_menu.scss | 122 |
1 files changed, 43 insertions, 79 deletions
diff --git a/src/objects/_menu.scss b/src/objects/_menu.scss index 12e9755..f9453ce 100644 --- a/src/objects/_menu.scss +++ b/src/objects/_menu.scss | |||
@@ -1,82 +1,41 @@ | |||
1 | /* stylelint-disable length-zero-no-unit */ | 1 | @use 'sass:meta'; |
2 | |||
3 | @use 'iro-sass/src/iro-sass' as iro; | 2 | @use 'iro-sass/src/iro-sass' as iro; |
4 | @use '../functions' as fn; | 3 | @use '../props'; |
5 | 4 | @use 'icon.vars' as icon; | |
6 | @use './icon'; | 5 | |
7 | 6 | @forward 'menu.vars'; | |
8 | @include iro.props-namespace('menu') { | 7 | @use 'menu.vars' as vars; |
9 | @include iro.props-store(( | 8 | |
10 | --dims: ( | 9 | @mixin styles { |
11 | --spacing: 0em, | 10 | @include props.materialize(meta.module-variables('vars')); |
12 | --header: ( | 11 | |
13 | --font-size: fn.global-dim(--font-size --50), | 12 | @include iro.bem-object('menu') { |
14 | ), | ||
15 | --separator: fn.global-dim(--size --100), | ||
16 | --item: ( | ||
17 | --pad-i: fn.global-dim(--size --150), | ||
18 | --pad-b: fn.global-dim(--size --100), | ||
19 | --rounding: 0em, | ||
20 | |||
21 | --key-focus: ( | ||
22 | --border: fn.global-dim(--key-focus --border), | ||
23 | --border-offset: fn.global-dim(--key-focus --border-offset), | ||
24 | --outline: fn.global-dim(--key-focus --outline), | ||
25 | ), | ||
26 | ), | ||
27 | ), | ||
28 | --colors: ( | ||
29 | --separator: fn.global-color(--border), | ||
30 | --header: ( | ||
31 | --label: fn.global-color(--heading), | ||
32 | ), | ||
33 | --item: ( | ||
34 | --hover: ( | ||
35 | --bg: fn.global-color(--border-mute), | ||
36 | --label: fn.global-color(--heading), | ||
37 | ), | ||
38 | --active: ( | ||
39 | --bg: fn.global-color(--border), | ||
40 | --label: fn.global-color(--heading), | ||
41 | ), | ||
42 | --disabled: ( | ||
43 | --label: fn.global-color(--text-disabled), | ||
44 | ), | ||
45 | --key-focus: ( | ||
46 | --border: fn.global-color(--focus --border), | ||
47 | --outline: fn.global-color(--focus --outline), | ||
48 | ), | ||
49 | ), | ||
50 | ), | ||
51 | )); | ||
52 | |||
53 | @include iro.bem-object(iro.props-namespace()) { | ||
54 | display: flex; | 13 | display: flex; |
55 | flex-direction: column; | 14 | flex-direction: column; |
56 | gap: fn.dim(--spacing); | 15 | gap: props.get(vars.$spacing); |
57 | 16 | ||
58 | @include iro.bem-elem('header') { | 17 | @include iro.bem-elem('header') { |
59 | padding-block: fn.dim(--item --pad-b); | 18 | padding-block: props.get(vars.$item--pad-b); |
60 | padding-inline: fn.dim(--item --pad-i); | 19 | padding-inline: props.get(vars.$item--pad-i); |
61 | font-size: fn.dim(--header --font-size); | 20 | font-size: props.get(vars.$header--font-size); |
62 | font-weight: 500; | 21 | font-weight: 500; |
63 | color: fn.color(--header --label); | 22 | color: props.get(vars.$header--label-color); |
64 | text-transform: uppercase; | 23 | text-transform: uppercase; |
65 | letter-spacing: .5px; | 24 | letter-spacing: .5px; |
66 | 25 | ||
67 | @include iro.bem-next-twin-elem { | 26 | @include iro.bem-next-twin-elem { |
68 | margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); | 27 | margin-block-start: calc(props.get(vars.$separator-width) + props.get(vars.$spacing)); |
69 | } | 28 | } |
70 | } | 29 | } |
71 | 30 | ||
72 | @include iro.bem-elem('item') { | 31 | @include iro.bem-elem('item') { |
73 | padding-block: fn.dim(--item --pad-b); | 32 | padding-block: props.get(vars.$item--pad-b); |
74 | padding-inline: fn.dim(--item --pad-i); | 33 | padding-inline: props.get(vars.$item--pad-i); |
75 | margin: calc(-1 * fn.dim(--item --key-focus --outline)); | 34 | margin: calc(-1 * props.get(vars.$item--key-focus--outline-width)); |
76 | color: fn.color(--item --disabled --label); | 35 | color: props.get(vars.$item--disabled--label-color); |
77 | background-clip: padding-box; | 36 | background-clip: padding-box; |
78 | border: fn.dim(--item --key-focus --outline) solid transparent; | 37 | border: props.get(vars.$item--key-focus--outline-width) solid transparent; |
79 | border-radius: calc(fn.dim(--item --rounding) + fn.dim(--item --key-focus --outline)); | 38 | border-radius: calc(props.get(vars.$item--rounding) + props.get(vars.$item--key-focus--outline-width)); |
80 | 39 | ||
81 | &:link, | 40 | &:link, |
82 | &:visited, | 41 | &:visited, |
@@ -84,23 +43,28 @@ | |||
84 | color: currentColor; | 43 | color: currentColor; |
85 | 44 | ||
86 | @include iro.bem-multi('&:hover, &:focus-visible', 'is' 'selected') { | 45 | @include iro.bem-multi('&:hover, &:focus-visible', 'is' 'selected') { |
87 | color: fn.color(--item --hover --label); | 46 | color: props.get(vars.$item--hover--label-color); |
88 | background-color: fn.color(--item --hover --bg); | 47 | background-color: props.get(vars.$item--hover--bg-color); |
89 | } | 48 | } |
90 | 49 | ||
91 | &:active { | 50 | &:active { |
92 | color: fn.color(--item --active --label); | 51 | color: props.get(vars.$item--active--label-color); |
93 | background-color: fn.color(--item --active --bg); | 52 | background-color: props.get(vars.$item--active--bg-color); |
94 | } | 53 | } |
95 | 54 | ||
96 | &:focus-visible { | 55 | &:focus-visible { |
97 | 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); |
98 | 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); | ||
99 | } | 63 | } |
100 | } | 64 | } |
101 | 65 | ||
102 | @include iro.bem-next-elem('header') { | 66 | @include iro.bem-next-elem('header') { |
103 | margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); | 67 | margin-block-start: calc(props.get(vars.$separator-width) + props.get(vars.$spacing)); |
104 | } | 68 | } |
105 | } | 69 | } |
106 | 70 | ||
@@ -108,30 +72,30 @@ | |||
108 | &:link, | 72 | &:link, |
109 | &:visited, | 73 | &:visited, |
110 | &:enabled { | 74 | &:enabled { |
111 | color: fn.color(--header --label); | 75 | color: props.get(vars.$header--label-color); |
112 | } | 76 | } |
113 | } | 77 | } |
114 | 78 | ||
115 | @include iro.bem-elem('separator') { | 79 | @include iro.bem-elem('separator') { |
116 | block-size: 1px; | 80 | block-size: 1px; |
117 | margin-block: fn.dim(--separator); | 81 | margin-block: props.get(vars.$separator-width); |
118 | margin-inline: fn.dim(--item --pad-i); | 82 | margin-inline: props.get(vars.$item--pad-i); |
119 | background-color: fn.color(--separator); | 83 | background-color: props.get(vars.$separator-color); |
120 | } | 84 | } |
121 | 85 | ||
122 | @include iro.bem-elem('slot') { | 86 | @include iro.bem-elem('slot') { |
123 | padding-block: fn.dim(--item --pad-b); | 87 | padding-block: props.get(vars.$item--pad-b); |
124 | padding-inline: fn.dim(--item --pad-i); | 88 | padding-inline: props.get(vars.$item--pad-i); |
125 | } | 89 | } |
126 | 90 | ||
127 | @include iro.bem-elem('icon-slot') { | 91 | @include iro.bem-elem('icon-slot') { |
128 | display: flex; | 92 | display: flex; |
129 | justify-content: center; | 93 | justify-content: center; |
130 | inline-size: fn.foreign-dim(--icon, --size); | 94 | inline-size: props.get(icon.$size); |
131 | } | 95 | } |
132 | 96 | ||
133 | @include iro.bem-modifier('pull') { | 97 | @include iro.bem-modifier('pull') { |
134 | margin: calc(-1 * fn.dim(--item --pad-i)); | 98 | margin: calc(-1 * props.get(vars.$item--pad-i)); |
135 | } | 99 | } |
136 | } | 100 | } |
137 | } | 101 | } |