forked from zombieFox/nightTab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.js
More file actions
45 lines (39 loc) · 830 Bytes
/
Copy paththeme.js
File metadata and controls
45 lines (39 loc) · 830 Bytes
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
var theme = (function() {
var toggle = function() {
var style = {
dark: function() {
helper.setObject({
object: state.get(),
path: "theme.style",
newValue: "light"
})
},
light: function() {
helper.setObject({
object: state.get(),
path: "theme.style",
newValue: "dark"
})
}
};
style[state.get().theme.style]();
};
var render = {
radius: function() {
_renderRadius();
}
};
var _renderRadius = function() {
var html = helper.e("html");
html.style.setProperty("--theme-radius", state.get().theme.radius + "rem");
};
var init = function() {
render.radius();
};
// exposed methods
return {
render: render,
toggle: toggle,
init: init
};
})();