Skip to content

Commit badcba7

Browse files
committed
Replace CSS vars with HTML vars
1 parent c8d3a4a commit badcba7

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

src/styles/app.scss

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
$body-font: 'Fira Sans', Helvetica, Arial, sans-serif;
44
$header-font: 'Alfa Slab One', serif;
55

6-
$gray: #2a3439;
7-
$red: #a72145;
8-
$green: #0b7261;
9-
$purple: #2e2459;
10-
$yellow: #ffc832;
6+
// Default light theme
7+
:root {
8+
--gray: #2a3439;
9+
--red: #a72145;
10+
--yellow: #ffc832;
11+
--code-bg-color: rgba(42, 52, 57, 0.05);
12+
--code-border-color: rgba(42, 52, 57, 0.25);
13+
--blockquote-bg-color: rgb(247, 249, 249);
14+
--blockquote-left-border-color: rgb(195, 205, 210);
15+
}
1116

1217
html {
1318
font-size: 62.5%
@@ -35,8 +40,8 @@ body {
3540
blockquote {
3641
font-style: italic;
3742
position: relative;
38-
background-color: lighten($gray, 78%);
39-
border-left: 8px solid lighten($gray, 60%);
43+
background-color: var(--blockquote-bg-color);
44+
border-left: 8px solid var(--blockquote-left-border-color);
4045
border-radius: 5px;
4146
margin: 0;
4247
margin-bottom: 2rem;
@@ -110,7 +115,7 @@ ul.nav, ul.nav li {
110115
}
111116

112117
.nav a {
113-
color: $gray;
118+
color: var(--gray);
114119
}
115120

116121
div.brand {
@@ -141,28 +146,27 @@ div.brand {
141146
.white {
142147
color: black;
143148
.highlight {
144-
background-color: $yellow;
149+
background-color: var(--yellow);
145150
}
146151
a {
147-
color: $gray;
152+
color: var(--gray);
148153
text-decoration: underline;
149154
}
150155
.button.button-secondary {
151-
background-color: $yellow;
152-
border: 1px solid $yellow;
153-
color: $gray;
156+
color: var(--gray);
157+
border: 1px solid var(--yellow);
154158
text-decoration: none;
155159
display: block;
156160
overflow: hidden;
157161
text-overflow: ellipsis;
158162
&:hover, &:focus {
159-
border-color: $gray;
163+
border-color: var(--gray);
160164
}
161165
}
162166
code {
163167
color: black;
164-
background-color: rgba($gray, 0.05);
165-
border: 1px solid rgba($gray, 0.25);
168+
background-color: var(--code-bg-color);
169+
border: 1px solid var(--code-border-color);
166170
}
167171

168172
a.anchor::before {
@@ -173,7 +177,7 @@ div.brand {
173177
margin-left: -1em;
174178
text-decoration: none;
175179
opacity: 0.7;
176-
color: $gray;
180+
color: var(--gray);
177181
font-weight: normal;
178182
}
179183
:hover > a.anchor::before {
@@ -194,18 +198,18 @@ ul {
194198
}
195199

196200
.posts {
197-
background-color: $gray;
201+
background-color: var(--gray);
198202
color: white;
199203
.highlight {
200-
background-color: $red;
204+
background-color: var(--red);
201205
}
202206
a {
203207
color: white;
204208
text-decoration: underline;
205209
}
206210
.button.button-secondary {
207-
background-color: $red;
208-
border: 1px solid $red;
211+
background-color: var(--red);
212+
border: 1px solid var(--red);
209213
color: white;
210214
text-decoration: none;
211215
display: block;
@@ -230,7 +234,7 @@ table.post-list a:hover {
230234
}
231235

232236
.publish-date-author {
233-
color: $gray;
237+
color: var(--gray);
234238
margin: -60px 0 60px 0;
235239
}
236240

@@ -245,11 +249,11 @@ footer {
245249
}
246250

247251
a {
248-
color: $yellow;
252+
color: var(--yellow);
249253
text-decoration: none;
250254

251255
&:hover {
252-
color: $yellow;
256+
color: var(--yellow);
253257
text-decoration: underline;
254258
}
255259
}
@@ -281,7 +285,7 @@ h3, .post h2, header h2 {
281285
h2 {
282286
font-size: 2em;
283287
}
284-
288+
285289
h3 {
286290
display: block;
287291
}
@@ -323,4 +327,3 @@ header h1 {
323327
border-top-left-radius: 0;
324328
}
325329
}
326-

0 commit comments

Comments
 (0)