summaryrefslogtreecommitdiffstats
path: root/src/objects/_divider.scss
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects/_divider.scss')
-rw-r--r--src/objects/_divider.scss132
1 files changed, 35 insertions, 97 deletions
diff --git a/src/objects/_divider.scss b/src/objects/_divider.scss
index 7d96206..122da78 100644
--- a/src/objects/_divider.scss
+++ b/src/objects/_divider.scss
@@ -1,89 +1,27 @@
1@use 'sass:map'; 1@use 'sass:map';
2@use 'sass:meta';
3@use 'sass:string';
2@use 'iro-sass/src/iro-sass' as iro; 4@use 'iro-sass/src/iro-sass' as iro;
3@use '../functions' as fn; 5@use '../props';
4@use '../config'; 6@use '../core.vars' as core;
5 7
6$static-themes: 'black' 'white' !default; 8@forward 'divider.vars';
9@use 'divider.vars' as vars;
7 10
8@include iro.props-namespace('divider') { 11@mixin styles {
9 @include iro.props-store(( 12 @include props.materialize(meta.module-variables('vars'));
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 13
76 @include iro.bem-object(iro.props-namespace()) { 14 @include iro.bem-object('divider') {
77 display: flex; 15 display: flex;
78 flex: 0 0 auto; 16 flex: 0 0 auto;
79 flex-direction: row; 17 flex-direction: row;
80 align-items: center; 18 align-items: center;
81 block-size: 1em; 19 block-size: 1em;
82 margin-block: fn.dim(--margin-b); 20 margin-block: props.get(vars.$margin-b);
83 font-size: fn.dim(--strong --label-font-size); 21 font-size: props.get(vars.$strong--label-font-size);
84 font-weight: 700; 22 font-weight: 700;
85 line-height: 1; 23 line-height: 1;
86 color: fn.color(--strong --label); 24 color: props.get(vars.$strong--label-color);
87 text-transform: uppercase; 25 text-transform: uppercase;
88 letter-spacing: .5px; 26 letter-spacing: .5px;
89 27
@@ -91,9 +29,9 @@ $static-themes: 'black' 'white' !default;
91 &::after { 29 &::after {
92 flex: 1 1 auto; 30 flex: 1 1 auto;
93 inline-size: 100%; 31 inline-size: 100%;
94 block-size: fn.dim(--strong --border); 32 block-size: props.get(vars.$strong--border-width);
95 content: ''; 33 content: '';
96 background-color: fn.color(--strong --bg); 34 background-color: props.get(vars.$strong--bg-color);
97 } 35 }
98 36
99 &::before { 37 &::before {
@@ -109,7 +47,7 @@ $static-themes: 'black' 'white' !default;
109 inline-size: 1px; 47 inline-size: 1px;
110 block-size: auto; 48 block-size: auto;
111 margin-block: 0; 49 margin-block: 0;
112 background-color: fn.color(--faint --bg); 50 background-color: props.get(vars.$faint--bg-color);
113 51
114 &::before, 52 &::before,
115 &::after { 53 &::after {
@@ -118,26 +56,26 @@ $static-themes: 'black' 'white' !default;
118 } 56 }
119 57
120 @include iro.bem-modifier('medium') { 58 @include iro.bem-modifier('medium') {
121 font-size: fn.dim(--medium --label-font-size); 59 font-size: props.get(vars.$medium--label-font-size);
122 font-weight: 500; 60 font-weight: 500;
123 color: fn.color(--medium --label); 61 color: props.get(vars.$medium--label-color);
124 62
125 &::before, 63 &::before,
126 &::after { 64 &::after {
127 block-size: fn.dim(--medium --border); 65 block-size: props.get(vars.$medium--border-width);
128 background-color: fn.color(--medium --bg); 66 background-color: props.get(vars.$medium--bg-color);
129 } 67 }
130 } 68 }
131 69
132 @include iro.bem-modifier('faint') { 70 @include iro.bem-modifier('faint') {
133 font-size: fn.dim(--faint --label-font-size); 71 font-size: props.get(vars.$faint--label-font-size);
134 font-weight: 500; 72 font-weight: 500;
135 color: fn.color(--faint --label); 73 color: props.get(vars.$faint--label-color);
136 74
137 &::before, 75 &::before,
138 &::after { 76 &::after {
139 block-size: fn.dim(--faint --border); 77 block-size: props.get(vars.$faint--border-width);
140 background-color: fn.color(--faint --bg); 78 background-color: props.get(vars.$faint--bg-color);
141 } 79 }
142 } 80 }
143 81
@@ -152,49 +90,49 @@ $static-themes: 'black' 'white' !default;
152 } 90 }
153 } 91 }
154 92
155 @each $color in 'blue' 'purple' 'red' 'green' 'yellow' { 93 @each $theme in map.keys(props.get(vars.$themes)) {
156 @include iro.bem-modifier($color) { 94 @include iro.bem-modifier(string.slice($theme, 3)) {
157 &::before, 95 &::before,
158 &::after { 96 &::after {
159 background-color: fn.color(--#{$color} --bg); 97 background-color: props.get(vars.$themes, $theme, --bg);
160 } 98 }
161 99
162 @include iro.bem-elem('label') { 100 @include iro.bem-elem('label') {
163 color: fn.color(--#{$color} --label); 101 color: props.get(vars.$themes, $theme, --label);
164 } 102 }
165 } 103 }
166 } 104 }
167 105
168 @each $theme in $static-themes { 106 @each $theme in map.keys(props.get(vars.$static-themes)) {
169 @include iro.bem-modifier(static-#{$theme}) { 107 @include iro.bem-modifier(string.slice($theme, 3)) {
170 &::before, 108 &::before,
171 &::after { 109 &::after {
172 background-color: fn.color(--static-#{$theme} --strong --bg); 110 background-color: props.get(vars.$static-themes, $theme, --strong, --bg);
173 } 111 }
174 112
175 @include iro.bem-elem('label') { 113 @include iro.bem-elem('label') {
176 color: fn.color(--static-#{$theme} --strong --label); 114 color: props.get(vars.$static-themes, $theme, --strong, --label);
177 } 115 }
178 116
179 @include iro.bem-modifier('medium') { 117 @include iro.bem-modifier('medium') {
180 &::before, 118 &::before,
181 &::after { 119 &::after {
182 background-color: fn.color(--static-#{$theme} --medium --bg); 120 background-color: props.get(vars.$static-themes, $theme, --medium, --bg);
183 } 121 }
184 122
185 @include iro.bem-elem('label') { 123 @include iro.bem-elem('label') {
186 color: fn.color(--static-#{$theme} --medium --label); 124 color: props.get(vars.$static-themes, $theme, --medium, --label);
187 } 125 }
188 } 126 }
189 127
190 @include iro.bem-modifier('faint') { 128 @include iro.bem-modifier('faint') {
191 &::before, 129 &::before,
192 &::after { 130 &::after {
193 background-color: fn.color(--static-#{$theme} --faint --bg); 131 background-color: props.get(vars.$static-themes, $theme, --faint, --bg);
194 } 132 }
195 133
196 @include iro.bem-elem('label') { 134 @include iro.bem-elem('label') {
197 color: fn.color(--static-#{$theme} --faint --label); 135 color: props.get(vars.$static-themes, $theme, --faint, --label);
198 } 136 }
199 } 137 }
200 } 138 }