1
1
// wider.scss is already setting the content width
2
2
$content-width : 75rem ;
3
3
4
+ // CSS Variables for light/dark themes
5
+ :root {
6
+ // Light theme variables
7
+ --bg-color : #fafdff ;
8
+ --text-color : black ;
9
+ --primary-color : #397DFF ;
10
+ --primary-hover : #245dcc ;
11
+ --border-color : #e1e4e8 ;
12
+ --table-header-bg : #e4ecfa ;
13
+ --table-stripe-bg : #f3f8fe ;
14
+ --table-border : #c6d5f9 ;
15
+ --table-row-border : #e4ecfa ;
16
+ --blockquote-bg : #f0f6fe ;
17
+ --hr-color : #e4ecfa ;
18
+ --card-bg : #ffffff ;
19
+ --card-shadow : rgba (0 , 0 , 0 , 0.1 );
20
+ }
21
+
22
+ [data-theme = " dark" ] {
23
+ // Dark theme variables
24
+ --bg-color : #0d1117 ;
25
+ --text-color : #f0f6fc ;
26
+ --primary-color : #58a6ff ;
27
+ --primary-hover : #79c0ff ;
28
+ --border-color : #30363d ;
29
+ --table-header-bg : #161b22 ;
30
+ --table-stripe-bg : #0d1117 ;
31
+ --table-border : #21262d ;
32
+ --table-row-border : #21262d ;
33
+ --blockquote-bg : #161b22 ;
34
+ --hr-color : #21262d ;
35
+ --card-bg : #161b22 ;
36
+ --card-shadow : rgba (0 , 0 , 0 , 0.3 );
37
+ }
38
+
4
39
// Global styles
5
40
6
41
body {
7
42
margin : 0 auto ;
8
43
font-family : ' Inter' , ' Helvetica Neue' , Arial , sans-serif ;
9
44
font-size : 1.1rem ;
10
- background : #fafdff ;
11
- color : black ;
45
+ background : var (--bg-color );
46
+ color : var (--text-color );
47
+ transition : background-color 0.3s ease , color 0.3s ease ;
12
48
}
13
49
14
50
// Links
15
51
a ,
16
52
a :visited {
17
- color : #397DFF !important ; // force blue for all links
53
+ color : var ( --primary-color ) !important ;
18
54
text-decoration : underline ;
19
55
font-weight : 500 ;
20
56
transition : color 0.15s ;
21
57
}
22
58
23
59
a :hover ,
24
60
a :focus {
25
- color : #245dcc !important ; // force dark blue for hover/focus
61
+ color : var ( --primary-hover ) !important ;
26
62
text-decoration : underline ;
27
63
}
28
64
29
65
30
66
// Headings
31
67
h1 , h2 , h3 , h4 , h5 , h6 {
32
- color : #397DFF ;
68
+ color : var ( --primary-color ) ;
33
69
font-weight : 700 ;
34
70
margin-top : 2.2rem ;
35
71
margin-bottom : 1.2rem ;
@@ -42,7 +78,7 @@ h1, h2, h3, h4, h5, h6 {
42
78
43
79
h2 {
44
80
font-size : 1.75rem ;
45
- border-bottom : 1px solid #e0ebfa ;
81
+ border-bottom : 1px solid var ( --border-color ) ;
46
82
padding-bottom : 0.2rem ;
47
83
}
48
84
@@ -57,7 +93,7 @@ h4, h5, h6 {
57
93
58
94
// Bold text
59
95
strong , b {
60
- color : #397DFF ;
96
+ color : var ( --primary-color ) ;
61
97
font-weight : 700 ;
62
98
}
63
99
@@ -66,30 +102,31 @@ table {
66
102
width : 100% ;
67
103
border-collapse : collapse ;
68
104
margin : 2rem 0 ;
69
- background : #fff ;
105
+ background : var ( --card-bg ) ;
70
106
font-size : 1rem ;
107
+ transition : background-color 0.3s ease ;
71
108
}
72
109
73
110
thead th {
74
- background : #e4ecfa ;
75
- color : #397DFF ;
111
+ background : var ( --table-header-bg ) ;
112
+ color : var ( --primary-color ) ;
76
113
font-weight : 700 ;
77
- border-bottom : 2px solid #c6d5f9 ;
114
+ border-bottom : 2px solid var ( --table-border ) ;
78
115
padding : 0.7rem ;
79
116
}
80
117
81
118
tbody td {
82
- border-bottom : 1px solid #e4ecfa ;
119
+ border-bottom : 1px solid var ( --table-row-border ) ;
83
120
padding : 0.7rem ;
84
121
vertical-align : top ;
85
122
}
86
123
87
124
tbody tr :nth-child (even ) {
88
- background : #f3f8fe ;
125
+ background : var ( --table-stripe-bg ) ;
89
126
}
90
127
91
128
.label {
92
- background : #397DFF ;
129
+ background : var ( --primary-color ) ;
93
130
color : #fff !important ; // ensures text stays white
94
131
border-radius : 1.3em ;
95
132
padding : 0.22em 1.1em ;
@@ -114,17 +151,18 @@ img {
114
151
}
115
152
116
153
blockquote {
117
- border-left : 4px solid #397DFF ;
118
- background : #f0f6fe ;
154
+ border-left : 4px solid var ( --primary-color ) ;
155
+ background : var ( --blockquote-bg ) ;
119
156
padding : 0.6em 1em ;
120
157
margin : 1.5em 0 ;
121
- color : #397DFF ;
158
+ color : var ( --primary-color ) ;
122
159
font-style : italic ;
160
+ transition : background-color 0.3s ease ;
123
161
}
124
162
125
163
hr {
126
164
border : none ;
127
- border-top : 2px solid #e4ecfa ;
165
+ border-top : 2px solid var ( --hr-color ) ;
128
166
margin : 3rem 0 ;
129
167
}
130
168
0 commit comments