diff options
Diffstat (limited to 'src/objects/_divider.scss')
-rw-r--r-- | src/objects/_divider.scss | 203 |
1 files changed, 203 insertions, 0 deletions
diff --git a/src/objects/_divider.scss b/src/objects/_divider.scss new file mode 100644 index 0000000..7d96206 --- /dev/null +++ b/src/objects/_divider.scss | |||
@@ -0,0 +1,203 @@ | |||
1 | @use 'sass:map'; | ||
2 | @use 'iro-sass/src/iro-sass' as iro; | ||
3 | @use '../functions' as fn; | ||
4 | @use '../config'; | ||
5 | |||
6 | $static-themes: 'black' 'white' !default; | ||
7 | |||
8 | @include iro.props-namespace('divider') { | ||
9 | @include iro.props-store(( | ||
10 | --dims: ( | ||
11 | --margin-b: fn.global-dim(--size --85), | ||
12 | |||
13 | --strong: ( | ||
14 | --border: fn.global-dim(--border --thick), | ||
15 | --label-font-size: fn.global-dim(--font-size --100), | ||
16 | ), | ||
17 | --medium: ( | ||
18 | --border: fn.global-dim(--border --medium), | ||
19 | --label-font-size: fn.global-dim(--font-size --75), | ||
20 | ), | ||
21 | --faint: ( | ||
22 | --border: fn.global-dim(--border --thin), | ||
23 | --label-font-size: fn.global-dim(--font-size --50), | ||
24 | ), | ||
25 | ), | ||
26 | --colors: ( | ||
27 | --strong: ( | ||
28 | --bg: fn.global-color(--text), | ||
29 | --label: fn.global-color(--text), | ||
30 | ), | ||
31 | --medium: ( | ||
32 | --bg: fn.global-color(--border), | ||
33 | --label: fn.global-color(--text-mute), | ||
34 | ), | ||
35 | --faint: ( | ||
36 | --bg: fn.global-color(--border), | ||
37 | --label: fn.global-color(--text-mute-more), | ||
38 | ), | ||
39 | ), | ||
40 | )); | ||
41 | |||
42 | @each $color in map.keys(map.get(config.$themes, config.$theme-default, --palettes)) { | ||
43 | @if $color != '--base' { | ||
44 | @include iro.props-store(( | ||
45 | --colors: ( | ||
46 | $color: ( | ||
47 | --bg: fn.global-color($color --800), | ||
48 | --label: fn.global-color($color --1000), | ||
49 | ) | ||
50 | ), | ||
51 | )); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | @each $theme in $static-themes { | ||
56 | @include iro.props-store(( | ||
57 | --colors: ( | ||
58 | --static-#{$theme}: ( | ||
59 | --strong: ( | ||
60 | --bg: fn.global-color(--#{$theme}-transparent --800), | ||
61 | --label: fn.global-color(--#{$theme}-transparent --900), | ||
62 | ), | ||
63 | --medium: ( | ||
64 | --bg: fn.global-color(--#{$theme}-transparent --300), | ||
65 | --label: fn.global-color(--#{$theme}-transparent --500), | ||
66 | ), | ||
67 | --faint: ( | ||
68 | --bg: fn.global-color(--#{$theme}-transparent --300), | ||
69 | --label: fn.global-color(--#{$theme}-transparent --500), | ||
70 | ), | ||
71 | ) | ||
72 | ), | ||
73 | )); | ||
74 | } | ||
75 | |||
76 | @include iro.bem-object(iro.props-namespace()) { | ||
77 | display: flex; | ||
78 | flex: 0 0 auto; | ||
79 | flex-direction: row; | ||
80 | align-items: center; | ||
81 | block-size: 1em; | ||
82 | margin-block: fn.dim(--margin-b); | ||
83 | font-size: fn.dim(--strong --label-font-size); | ||
84 | font-weight: 700; | ||
85 | line-height: 1; | ||
86 | color: fn.color(--strong --label); | ||
87 | text-transform: uppercase; | ||
88 | letter-spacing: .5px; | ||
89 | |||
90 | &::before, | ||
91 | &::after { | ||
92 | flex: 1 1 auto; | ||
93 | inline-size: 100%; | ||
94 | block-size: fn.dim(--strong --border); | ||
95 | content: ''; | ||
96 | background-color: fn.color(--strong --bg); | ||
97 | } | ||
98 | |||
99 | &::before { | ||
100 | display: block; | ||
101 | } | ||
102 | |||
103 | @include iro.bem-elem('label') { | ||
104 | flex: 0 0 auto; | ||
105 | } | ||
106 | |||
107 | @include iro.bem-modifier('vertical') { | ||
108 | align-self: stretch; | ||
109 | inline-size: 1px; | ||
110 | block-size: auto; | ||
111 | margin-block: 0; | ||
112 | background-color: fn.color(--faint --bg); | ||
113 | |||
114 | &::before, | ||
115 | &::after { | ||
116 | display: none; | ||
117 | } | ||
118 | } | ||
119 | |||
120 | @include iro.bem-modifier('medium') { | ||
121 | font-size: fn.dim(--medium --label-font-size); | ||
122 | font-weight: 500; | ||
123 | color: fn.color(--medium --label); | ||
124 | |||
125 | &::before, | ||
126 | &::after { | ||
127 | block-size: fn.dim(--medium --border); | ||
128 | background-color: fn.color(--medium --bg); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | @include iro.bem-modifier('faint') { | ||
133 | font-size: fn.dim(--faint --label-font-size); | ||
134 | font-weight: 500; | ||
135 | color: fn.color(--faint --label); | ||
136 | |||
137 | &::before, | ||
138 | &::after { | ||
139 | block-size: fn.dim(--faint --border); | ||
140 | background-color: fn.color(--faint --bg); | ||
141 | } | ||
142 | } | ||
143 | |||
144 | @include iro.bem-modifier('labelled') { | ||
145 | &::before { | ||
146 | margin-inline-end: 1em; | ||
147 | } | ||
148 | |||
149 | &::after { | ||
150 | display: block; | ||
151 | margin-inline-start: 1em; | ||
152 | } | ||
153 | } | ||
154 | |||
155 | @each $color in 'blue' 'purple' 'red' 'green' 'yellow' { | ||
156 | @include iro.bem-modifier($color) { | ||
157 | &::before, | ||
158 | &::after { | ||
159 | background-color: fn.color(--#{$color} --bg); | ||
160 | } | ||
161 | |||
162 | @include iro.bem-elem('label') { | ||
163 | color: fn.color(--#{$color} --label); | ||
164 | } | ||
165 | } | ||
166 | } | ||
167 | |||
168 | @each $theme in $static-themes { | ||
169 | @include iro.bem-modifier(static-#{$theme}) { | ||
170 | &::before, | ||
171 | &::after { | ||
172 | background-color: fn.color(--static-#{$theme} --strong --bg); | ||
173 | } | ||
174 | |||
175 | @include iro.bem-elem('label') { | ||
176 | color: fn.color(--static-#{$theme} --strong --label); | ||
177 | } | ||
178 | |||
179 | @include iro.bem-modifier('medium') { | ||
180 | &::before, | ||
181 | &::after { | ||
182 | background-color: fn.color(--static-#{$theme} --medium --bg); | ||
183 | } | ||
184 | |||
185 | @include iro.bem-elem('label') { | ||
186 | color: fn.color(--static-#{$theme} --medium --label); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | @include iro.bem-modifier('faint') { | ||
191 | &::before, | ||
192 | &::after { | ||
193 | background-color: fn.color(--static-#{$theme} --faint --bg); | ||
194 | } | ||
195 | |||
196 | @include iro.bem-elem('label') { | ||
197 | color: fn.color(--static-#{$theme} --faint --label); | ||
198 | } | ||
199 | } | ||
200 | } | ||
201 | } | ||
202 | } | ||
203 | } | ||