Skip to content

Commit 5046d54

Browse files
committed
Refactor SCSS to use variables for color and responsive styles
1 parent 14b7f10 commit 5046d54

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

assets/style.scss

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77

88
@use "../_sass/_reset";
9-
@use "../_sass/_variables" as *;
109
@use "../_sass/_darcula";
1110
@use "../_sass/_svg-icons";
11+
@use "../_sass/_variables" as variables;
1212
// Syntax highlighting partial is still commented out
1313
//@use "../_sass/_highlights";
1414

@@ -42,15 +42,15 @@ body {
4242

4343
h1, h2, h3, h4, h5, h6 {
4444
font-family: -system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
45-
color: $darkerGray;
45+
color: variables.$darkerGray;
4646
font-weight: bold;
4747

4848
line-height: 1.7;
4949
margin: 1em 0 15px;
5050
padding: 0;
5151
text-align: center;
5252

53-
@include mobile {
53+
@include variables.mobile {
5454
line-height: 1.4;
5555
}
5656
}
@@ -162,7 +162,7 @@ table tr td :last-child {
162162
span[data-pullquote] {
163163
display: block;
164164

165-
@include mobile {
165+
@include variables.mobile {
166166
display: none;
167167
}
168168
}
@@ -180,11 +180,11 @@ span[data-pullquote]:before {
180180
}
181181

182182
a {
183-
color: $blue;
183+
color: variables.$blue;
184184
text-decoration: none;
185185
cursor: pointer;
186186
&:hover, &:active {
187-
color: $blue;
187+
color: variables.$blue;
188188
}
189189
}
190190

@@ -266,17 +266,17 @@ p > img {
266266

267267
.date {
268268
font-style: italic;
269-
color: $gray;
269+
color: variables.$gray;
270270
}
271271

272272
// Specify the color of the selection
273273
::-moz-selection {
274-
color: $black;
275-
background: $lightGray;
274+
color: variables.$black;
275+
background: variables.$lightGray;
276276
}
277277
::selection {
278-
color: $black;
279-
background: $lightGray;
278+
color: variables.$black;
279+
background: variables.$lightGray;
280280
}
281281

282282
// Nicolas Gallagher's micro clearfix hack
@@ -305,9 +305,9 @@ p > img {
305305

306306
.masthead {
307307
padding: 20px 0;
308-
border-bottom: 1px solid $lightGray;
308+
border-bottom: 1px solid variables.$lightGray;
309309

310-
@include mobile {
310+
@include variables.mobile {
311311
text-align: center;
312312
}
313313
}
@@ -318,7 +318,7 @@ p > img {
318318
height: 100px;
319319
margin-right: 15px;
320320

321-
@include mobile {
321+
@include variables.mobile {
322322
float: none;
323323
display: block;
324324
margin: 0 auto;
@@ -335,7 +335,7 @@ p > img {
335335
float: left;
336336
margin-left: 38px;
337337

338-
@include mobile {
338+
@include variables.mobile {
339339
float: none;
340340
display: block;
341341
margin: 0 auto;
@@ -344,36 +344,36 @@ p > img {
344344

345345
.site-name {
346346
margin: 0;
347-
color: $darkGray;
347+
color: variables.$darkGray;
348348
cursor: pointer;
349-
font-family: $helveticaNeue;
349+
font-family: variables.$helveticaNeue;
350350
font-weight: 300;
351351
font-size: 28px;
352352
letter-spacing: 1px;
353353
text-align: left;
354354

355-
@include mobile {
355+
@include variables.mobile {
356356
text-align: center;
357357
}
358358
}
359359

360360
.site-description {
361361
margin: -5px 0 0 0;
362-
color: $gray;
362+
color: variables.$gray;
363363
font-size: 16px;
364364

365-
@include mobile {
365+
@include variables.mobile {
366366
margin: 3px 0;
367367
}
368368
}
369369

370370
nav {
371371
float: right;
372372
margin-top: 23px; // @TODO: Vertically middle align
373-
font-family: $helveticaNeue;
373+
font-family: variables.$helveticaNeue;
374374
font-size: 18px;
375375

376-
@include mobile {
376+
@include variables.mobile {
377377
float: none;
378378
margin-top: 9px;
379379
display: block;
@@ -382,14 +382,14 @@ nav {
382382

383383
a {
384384
margin-left: 20px;
385-
color: $darkGray;
385+
color: variables.$darkGray;
386386
text-align: right;
387387
font-weight: 300;
388388
letter-spacing: 1px;
389389

390-
@include mobile {
390+
@include variables.mobile {
391391
margin: 0 10px;
392-
color: $blue;
392+
color: variables.$blue;
393393
}
394394
}
395395
}
@@ -400,7 +400,7 @@ nav {
400400

401401
.posts > .post {
402402
padding-bottom: 2em;
403-
border-bottom: 1px solid $lightGray;
403+
border-bottom: 1px solid variables.$lightGray;
404404
}
405405

406406
.posts > .post:last-child {
@@ -411,19 +411,19 @@ nav {
411411
.post {
412412
blockquote {
413413
margin: 1.8em .8em;
414-
/*border-left: 2px solid $gray;*/
414+
/*border-left: 2px solid variables.$gray;*/
415415
padding: 0.1em 1em;
416-
color: $gray;
416+
color: variables.$gray;
417417
font-size: 22px;
418418
font-style: italic;
419419
background-color: #ede1ff;
420420
}
421421

422422
.you-may-like{
423423
margin: 1.8em .8em;
424-
/*border-left: 2px solid $gray;*/
424+
/*border-left: 2px solid variables.$gray;*/
425425
padding: 0.1em 1em;
426-
color: $gray;
426+
color: variables.$gray;
427427
font-size: 22px;
428428
font-style: italic;
429429
background-color: #ddffb5;;
@@ -453,7 +453,7 @@ nav {
453453
bottom: 0;
454454
width: 100%;
455455
height: 89px;
456-
background-color: $lightGray;
456+
background-color: variables.$lightGray;
457457
}
458458

459459
footer {

0 commit comments

Comments
 (0)