diff options
author | Volpeon <git@volpeon.ink> | 2024-12-10 11:40:28 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-12-10 11:40:28 +0100 |
commit | 2448ebfdef6a15549137cf42116168f467bae393 (patch) | |
tree | 770606867cdbc11a0d56777c77926504aa586ea1 /src/_core.vars.scss | |
parent | Update (diff) | |
download | furbase-design-2024-2448ebfdef6a15549137cf42116168f467bae393.tar.gz furbase-design-2024-2448ebfdef6a15549137cf42116168f467bae393.tar.bz2 furbase-design-2024-2448ebfdef6a15549137cf42116168f467bae393.zip |
Refactoring
Diffstat (limited to 'src/_core.vars.scss')
-rw-r--r-- | src/_core.vars.scss | 175 |
1 files changed, 171 insertions, 4 deletions
diff --git a/src/_core.vars.scss b/src/_core.vars.scss index 3c6aba8..c9117b5 100644 --- a/src/_core.vars.scss +++ b/src/_core.vars.scss | |||
@@ -1,8 +1,10 @@ | |||
1 | @use 'sass:list'; | 1 | @use 'sass:list'; |
2 | @use 'sass:map'; | 2 | @use 'sass:map'; |
3 | @use 'sass:math'; | 3 | @use 'sass:math'; |
4 | @use 'sass:meta'; | ||
4 | @use 'iro-sass/src/props'; | 5 | @use 'iro-sass/src/props'; |
5 | @use 'iro-sass/src/easing'; | 6 | @use 'iro-sass/src/easing'; |
7 | @use 'iro-sass/src/functions'; | ||
6 | @use 'iro-design/src/functions' as fn; | 8 | @use 'iro-design/src/functions' as fn; |
7 | 9 | ||
8 | $themes-spec: ( | 10 | $themes-spec: ( |
@@ -42,12 +44,83 @@ $themes-spec: ( | |||
42 | ), | 44 | ), |
43 | 45 | ||
44 | --palettes: ( | 46 | --palettes: ( |
45 | --base: #edddc4 --grays, | 47 | --base: #edddc4 --grays, |
46 | --red: oklch(36.32% 0.1302 53.73) --colors, | 48 | --red: oklch(36.32% 0.1302 53.73) --colors, |
47 | --blue: oklch(36.4% 0.1302 273.58) --colors, | 49 | --blue: oklch(36.32% 0.1302 273.58) --colors, |
48 | --yellow: oklch(36.32% 0.1302 92.94) --colors, | 50 | --yellow: oklch(36.32% 0.1302 92.94) --colors, |
51 | ), | ||
52 | |||
53 | --semantic: ( | ||
54 | --bg-l2: --base --50, | ||
55 | --bg-l1: --base --75, | ||
56 | --bg-base: --base --100, | ||
57 | |||
58 | --link: ( | ||
59 | --fg: --red --1000, | ||
60 | --underline: --red --400, | ||
61 | --fg-inv: --red --1000-text, | ||
62 | --active: --red --1300, | ||
63 | --active-inv: --red --1300-text, | ||
64 | ) | ||
49 | ), | 65 | ), |
50 | ), | 66 | ), |
67 | |||
68 | --dark: ( | ||
69 | --levels: ( | ||
70 | --grays: ( | ||
71 | --50: #000, | ||
72 | --75: (easing.cubic-bezier(.3, .1, .7, 1, math.div(7, 7)) * 87) (.8 + 1.2 * math.div(6, 6)) (-30 * math.div(7, 7)), | ||
73 | --100: (easing.cubic-bezier(.3, .1, .7, 1, math.div(6, 7)) * 87) (.8 + 1.2 * math.div(5, 6)) (-30 * math.div(6, 7)), | ||
74 | |||
75 | --200: (easing.cubic-bezier(.3, .1, .7, 1, math.div(5, 7)) * 87) (.8 + 1.2 * math.div(4, 6)) (-30 * math.div(5, 7)), | ||
76 | --300: (easing.cubic-bezier(.3, .1, .7, 1, math.div(4, 7)) * 87) (.8 + 1.2 * math.div(3, 6)) (-30 * math.div(4, 7)), | ||
77 | --400: (easing.cubic-bezier(.3, .1, .7, 1, math.div(3, 7)) * 87) (.8 + 1.2 * math.div(2, 6)) (-30 * math.div(3, 7)), | ||
78 | |||
79 | --500: (easing.cubic-bezier(.3, .1, .7, 1, math.div(2, 7)) * 87) (.8 + 1.2 * math.div(1, 6)) (-30 * math.div(2, 7)), | ||
80 | --600: (easing.cubic-bezier(.3, .1, .7, 1, math.div(1, 7)) * 87) (.8 + 1.2 * math.div(0, 6)) (-30 * math.div(1, 7)), | ||
81 | --700: (0) .5 0, | ||
82 | --800: (-16) .3 0, | ||
83 | --900: (-30) .1 0, | ||
84 | ), | ||
85 | |||
86 | --colors: ( | ||
87 | --100: (math.div(12, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(12, 12))) (-30 * math.div(12, 12)), | ||
88 | --200: (math.div(11, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(11, 12))) (-30 * math.div(11, 12)), | ||
89 | --300: (math.div(10, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(10, 12))) (-30 * math.div(10, 12)), | ||
90 | --400: (math.div(9, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(9, 12))) (-30 * math.div(9, 12)), | ||
91 | --500: (math.div(8, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(8, 12))) (-30 * math.div(8, 12)), | ||
92 | --600: (math.div(7, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(7, 12))) (-30 * math.div(7, 12)), | ||
93 | --700: (math.div(6, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(6, 12))) (-30 * math.div(6, 12)), | ||
94 | --800: (math.div(5, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(5, 12))) (-30 * math.div(5, 12)), | ||
95 | --900: (math.div(4, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(4, 12))) (-30 * math.div(4, 12)), | ||
96 | --1000: (math.div(3, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(3, 12))) (-30 * math.div(3, 12)), | ||
97 | --1100: (math.div(2, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(2, 12))) (-30 * math.div(2, 12)), | ||
98 | --1200: (math.div(1, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(1, 12))) (-30 * math.div(1, 12)), | ||
99 | --1300: (math.div(0, 12) * 97 - 10) (.3 + .7 * easing.ease(math.div(0, 12))) (-30 * math.div(0, 12)), | ||
100 | ), | ||
101 | ), | ||
102 | |||
103 | --palettes: ( | ||
104 | --base: #edddc4 --grays, | ||
105 | --red: oklch(36.32% 0.1302 53.73) --colors, | ||
106 | --blue: oklch(36.32% 0.1302 273.58) --colors, | ||
107 | --yellow: oklch(36.32% 0.1302 92.94) --colors, | ||
108 | ), | ||
109 | |||
110 | --semantic: ( | ||
111 | --bg-l2: --base --50, | ||
112 | --bg-l1: --base --75, | ||
113 | --bg-base: --base --100, | ||
114 | |||
115 | --link: ( | ||
116 | --fg: --red --1000, | ||
117 | --underline: --red --400, | ||
118 | --fg-inv: --red --1000-text, | ||
119 | --active: --red --1300, | ||
120 | --active-inv: --red --1300-text, | ||
121 | ) | ||
122 | ), | ||
123 | ) | ||
51 | ); | 124 | ); |
52 | 125 | ||
53 | $themes: (); | 126 | $themes: (); |
@@ -63,7 +136,101 @@ $themes: (); | |||
63 | $compiled: props.merge($compiled, ( $palette-name: $palette )); | 136 | $compiled: props.merge($compiled, ( $palette-name: $palette )); |
64 | } | 137 | } |
65 | 138 | ||
139 | @each $color, $ref in map.get($theme, --semantic) { | ||
140 | $res: (); | ||
141 | |||
142 | @if meta.type-of($ref) == 'map' { | ||
143 | @each $key, $r in $ref { | ||
144 | $re1: list.nth($r, 1); | ||
145 | $re2: functions.list-slice($r, 2); | ||
146 | $res: map.merge($res, ($key: props.get($compiled, $re1, $re2...))); | ||
147 | } | ||
148 | } @else { | ||
149 | $ref1: list.nth($ref, 1); | ||
150 | $ref2: functions.list-slice($ref, 2); | ||
151 | $res: props.get($compiled, $ref1, $ref2...); | ||
152 | } | ||
153 | |||
154 | $compiled: props.merge($compiled, ( $color: $res )); | ||
155 | } | ||
156 | |||
66 | $themes: map.set($themes, $theme-name, $compiled); | 157 | $themes: map.set($themes, $theme-name, $compiled); |
67 | } | 158 | } |
68 | 159 | ||
69 | $theme: map.get($themes, --light); | 160 | $theme: map.get($themes, --light); |
161 | |||
162 | // | ||
163 | |||
164 | $vlpnLink: props.def(--vlpnLink, props.get($theme, --link, --fg)); | ||
165 | $vlpnLinkUnderline: props.def(--vlpnLinkUnderline, props.get($theme, --link, --underline)); | ||
166 | $vlpnLinkFg: props.def(--vlpnLinkFg, props.get($theme, --link, --fg-inv)); | ||
167 | $vlpnLinkActive: props.def(--vlpnLinkActive, props.get($theme, --link, --active)); | ||
168 | $vlpnLinkActiveFg: props.def(--vlpnLinkActiveFg, props.get($theme, --link, --active-inv)); | ||
169 | |||
170 | $vlpnSmileySize: props.def(--vlpnSmileySize, 28px); | ||
171 | |||
172 | $wcfFontSizeHeadline: props.def(--wcfFontSizeHeadline, 16px); | ||
173 | |||
174 | $wcfHeaderBackground: props.def(--wcfHeaderBackground, props.get($theme, --base, --700)); | ||
175 | $wcfHeaderMenuBackground: props.def(--wcfHeaderMenuBackground, props.get($theme, --base, --800)); | ||
176 | $wcfHeaderMenuLinkBackground: props.def(--wcfHeaderMenuLinkBackground, props.get($theme, --base, --800)); | ||
177 | $wcfHeaderMenuLinkBackgroundActive: props.def(--wcfHeaderMenuLinkBackgroundActive, props.get($theme, --base, --700)); | ||
178 | $wcfHeaderMenuDropdownBackground: props.def(--wcfHeaderMenuDropdownBackground, props.get($theme, --base, --800)); | ||
179 | $wcfHeaderMenuDropdownBorder: props.def(--wcfHeaderMenuDropdownBorder, props.get($theme, --base, --800)); | ||
180 | $wcfHeaderMenuDropdownBackgroundActive: props.def(--wcfHeaderMenuDropdownBackgroundActive, props.get($theme, --base, --700)); | ||
181 | |||
182 | $wcfNavigationBackground: props.def(--wcfNavigationBackground, props.get($theme, --bg-base)); | ||
183 | $wcfNavigationText: props.def(--wcfNavigationText, props.get($theme, --base, --500)); | ||
184 | $wcfNavigationLink: props.def(--wcfNavigationLink, props.get($theme, --base, --800)); | ||
185 | $wcfNavigationLinkActive: props.def(--wcfNavigationLinkActive, props.get($theme, --base, --800)); | ||
186 | |||
187 | $wcfContentBackground: props.def(--wcfContentBackground, rgb(242, 242, 242)); | ||
188 | $wcfContentBorder: props.def(--wcfContentBorder, var(--wcfContentBorderInner)); | ||
189 | $wcfContentDimmedText: props.def(--wcfContentDimmedText, rgba(0, 0, 0, .6)); | ||
190 | $wcfContentDimmedLink: props.def(--wcfContentDimmedLink, rgba(0, 0, 0, .6)); | ||
191 | |||
192 | $wcfFooterBoxBackground: props.def(--wcfFooterBoxBackground, props.get($theme, --bg-base)); | ||
193 | $wcfFooterBoxText: props.def(--wcfFooterBoxText, props.get($theme, --base, --800)); | ||
194 | $wcfFooterBoxHeadlineText: props.def(--wcfFooterBoxText, props.get($theme, --base, --900)); | ||
195 | |||
196 | $wcfFooterBackground: props.def(--wcfFooterBackground, props.get($theme, --base, --700)); | ||
197 | $wcfFooterText: props.def(--wcfFooterText, props.get($theme, --base, --100)); | ||
198 | $wcfFooterLink: props.def(--wcfFooterLink, props.get($theme, --base, --75)); | ||
199 | $wcfFooterLinkActive: props.def(--wcfFooterLinkActive, props.get($theme, --base, --75)); | ||
200 | |||
201 | $wcfFooterCopyrightBackground: props.def(--wcfFooterCopyrightBackground, props.get($theme, --base, --800)); | ||
202 | $wcfFooterCopyrightText: props.def(--wcfFooterCopyrightText, props.get($theme, --base, --75)); | ||
203 | $wcfFooterCopyrightLink: props.def(--wcfFooterCopyrightLink, props.get($theme, --base, --50)); | ||
204 | $wcfFooterCopyrightLinkActive: props.def(--wcfFooterCopyrightLinkActive, props.get($theme, --base, --50)); | ||
205 | |||
206 | $wcfSidebarBackground: props.def(--wcfSidebarBackground, $wcfContentBackground); | ||
207 | $wcfSidebarDimmedText: props.def(--wcfSidebarDimmedText, props.get($wcfContentDimmedText)); | ||
208 | |||
209 | $wcfButtonBackground: props.def(--wcfButtonBackground, props.get($theme, --base, --100)); | ||
210 | $wcfButtonText: props.def(--wcfButtonText, props.get($theme, --base, --100-text)); | ||
211 | $wcfButtonBackgroundActive: props.def(--wcfButtonBackgroundActive, props.get($theme, --base, --700)); | ||
212 | $wcfButtonTextActive: props.def(--wcfButtonTextActive, props.get($theme, --base, --700-text)); | ||
213 | |||
214 | $wcfButtonPrimaryBackground: props.def(--wcfButtonPrimaryBackground, props.get($theme, --red, --900)); | ||
215 | $wcfButtonPrimaryText: props.def(--wcfButtonTextBackground, props.get($theme, --red, --900-text)); | ||
216 | $wcfButtonPrimaryBackgroundActive: props.def(--wcfButtonPrimaryBackgroundActive, props.get($theme, --red, --1200)); | ||
217 | $wcfButtonPrimaryTextActive: props.def(--wcfButtonTextBackgroundActive, props.get($theme, --red, --1200-text)); | ||
218 | |||
219 | $wcfBoxShadowCard: props.def(--wcfBoxShadowCard, none); | ||
220 | |||
221 | $wcfContentContainerBorder: props.def(--wcfContentContainerBorder, var(--wcfContentContainerBackground)); | ||
222 | |||
223 | $wcfContentLink: props.def(--wcfContentLink, props.get($vlpnLink)); | ||
224 | $wcfContentLinkActive: props.def(--wcfContentLinkActive, props.get($vlpnLinkActive)); | ||
225 | |||
226 | $wcfSidebarLink: props.def(--wcfSidebarLink, props.get($vlpnLink)); | ||
227 | $wcfSidebarLinkActive: props.def(--wcfSidebarLinkActive, props.get($vlpnLinkActive)); | ||
228 | |||
229 | $wcfFooterBoxLink: props.def(--wcfFooterBoxLink, props.get($vlpnLink)); | ||
230 | $wcfFooterBoxLinkActive: props.def(--wcfFooterBoxLinkActive, props.get($vlpnLinkActive)); | ||
231 | |||
232 | $wcfTabularBoxHeadline: props.def(--wcfTabularBoxHeadline, props.get($vlpnLink)); | ||
233 | $wcfTabularBoxHeadlineActive: props.def(--wcfTabularBoxHeadlineActive, props.get($vlpnLinkActive)); | ||
234 | |||
235 | $wcfStatusInfoBackground: props.def(--wcfStatusInfoBackground, props.get($theme, --blue, --200)); | ||
236 | $wcfStatusInfoText: props.def(--wcfStatusInfoText, props.get($theme, --blue, --1200)); | ||