-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstyles.js
64 lines (60 loc) · 1.6 KB
/
styles.js
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
function addStyles() {
let css = `
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
padding: 0 15px;
max-width: 1200px;
margin: auto;
}
table {
border-collapse: collapse;
width: 100%;
margin-top: 50px;
box-shadow: 0px 0px 20px rgba(0,0,0,0.15);
border-radius: 10px;
overflow: hidden;
}
th, td {
text-align: left;
padding: 8px;
}
.actions {
display: flex;
justify-content: space-between;
align-items: center;
}
.clear {
color: #f44336;
}
`;
let style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
}
addStyles();
let themeColors;
if (window.enableSearchFeature) {
themeColors = {
'--h1-color': '#2196F3',
'--th-bg-color': '#2196F3',
'--a-color': '#2196F3',
'--tr-bg-color': '#c2e0fb',
'--a-color': '#2196F3',
};
} else {
themeColors = {
'--h1-color': '#4CAF50',
'--th-bg-color': '#4CAF50',
'--a-color': '#4CAF50',
'--tr-bg-color': '#fbfde3',
'--button-color': '#4CAF50',
'--button-hover-color': '#388E3C',
'--a-color': '#4CAF50',
};
}
// Apply the theme colors to the root of the document
Object.keys(themeColors).forEach((key) => {
document.documentElement.style.setProperty(key, themeColors[key]);
});