-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_index.scss
107 lines (100 loc) · 3.56 KB
/
_index.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
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
@use "sass:map";
@use "sass:meta";
@use "sass:string";
@use "sass:list";
@use "../light" as l;
@use "../dark" as d;
@use "../layout";
// Overrides default options with light mode/dark mode specific version.
@function override($override: false, $base) {
@if $override != false {
@return $override;
}
@return $base;
}
// Get an option from a set.
@function get($collection, $value, $sub: false) {
@if $sub != false {
@return map-get($collection, $sub, $value);
}
@return map-get($collection, $value);
}
// Light mode
$light: (
"background": override(l.$background, l.$background_),
"border": override(l.$border, l.$border_),
"lines": override(l.$lines, l.$lines_),
"text": override(l.$text, l.$text_),
"header-text": override(l.$header-text, l.$header-text_),
"special-text": override(l.$special-text, l.$special-text_),
"hover": override(l.$hover, l.$hover_),
"links-background": override(l.$links-background, l.$links-background_),
"highlight": override(l.$highlight, l.$highlight_),
);
// Dark mode
$dark: (
"background": override(d.$background, d.$background_),
"border": override(d.$border, d.$border_),
"lines": override(d.$lines, d.$lines_),
"text": override(d.$text, d.$text_),
"header-text": override(d.$header-text, d.$header-text_),
"special-text": override(d.$special-text, d.$special-text_),
"hover": override(d.$hover, d.$hover_),
"links-background": override(d.$links-background, d.$links-background_),
"highlight": override(d.$highlight, d.$highlight_),
);
// Callouts
$callout-types: "note", "abstract", "info", "todo", "tip", "success", "question", "warning",
"failure", "danger", "bug", "example", "quote";
:root[saved-theme="light"] {
--light: #{get($light, "background")} !important;
--lightgray: #{get($light, "border")} !important;
--gray: #{get($light, "lines")} !important;
--darkgray: #{get($light, "text")} !important;
--dark: #{get($light, "header-text")} !important;
--secondary: #{get($light, "special-text")} !important;
--tertiary: #{get($light, "hover")} !important;
--highlight: #{get($light, "links-background")} !important;
--textHighlight: #{get($light, "highlight")} !important;
.callout {
@each $type in $callout-types {
&[data-callout="#{$type}"] {
--color: #{override(get(l.$callouts, "color", $type), get(l.$callouts_, "color", $type))};
--border: #{override(
get(l.$callouts, "border", $type),
get(l.$callouts_, "border", $type)
)};
--bg: #{override(
get(l.$callouts, "background", $type),
get(l.$callouts_, "background", $type)
)};
}
}
}
}
:root {
--light: #{get($dark, "background")} !important;
--lightgray: #{get($dark, "border")} !important;
--gray: #{get($dark, "lines")} !important;
--darkgray: #{get($dark, "text")} !important;
--dark: #{get($dark, "header-text")} !important;
--secondary: #{get($dark, "special-text")} !important;
--tertiary: #{get($dark, "hover")} !important;
--highlight: #{get($dark, "links-background")} !important;
--textHighlight: #{get($dark, "highlight")} !important;
.callout {
@each $type in $callout-types {
&[data-callout="#{$type}"] {
--color: #{override(get(d.$callouts, "color", $type), get(d.$callouts_, "color", $type))};
--border: #{override(
get(d.$callouts, "border", $type),
get(d.$callouts_, "border", $type)
)};
--bg: #{override(
get(d.$callouts, "background", $type),
get(d.$callouts_, "background", $type)
)};
}
}
}
}