-
Notifications
You must be signed in to change notification settings - Fork 171
/
_base_themes.scss
52 lines (44 loc) · 1.24 KB
/
_base_themes.scss
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
@import 'settings';
@mixin vf-theme-light {
--vf-theme-light: var(--vf-FLAG-ON);
--vf-theme-dark: var(--vf-FLAG-OFF);
@include vf-theme-light--colors;
}
@mixin vf-theme-dark {
--vf-theme-light: var(--vf-FLAG-OFF);
--vf-theme-dark: var(--vf-FLAG-ON);
@include vf-theme-dark--colors;
}
@mixin vf-theme-paper {
// we treat the paper theme as a light theme
--vf-theme-light: var(--vf-FLAG-ON);
--vf-theme-dark: var(--vf-FLAG-OFF);
@include vf-theme-paper--colors;
}
// Color themes
@mixin vf-b-themes {
@at-root {
:root {
// based on:
// https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
--vf-FLAG-ON: initial;
--vf-FLAG-OFF: ;
}
:root,
.is-light {
@include vf-theme-light;
}
.is-dark {
@include vf-theme-dark;
}
.is-paper {
@include vf-theme-paper;
}
}
}
// based on:
// https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
// https://lea.verou.me/blog/2021/10/custom-properties-with-defaults/
@mixin vf-themed-property($property, $light-value, $dark-value) {
#{$property}: var(--vf-theme-light, #{$light-value}) var(--vf-theme-dark, #{$dark-value});
}