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