Refactor and split SCSS files, add mixins

This commit is contained in:
Xevion
2022-09-20 19:49:40 -05:00
parent ca9406e133
commit 13b5e61de2
4 changed files with 97 additions and 82 deletions

31
_sass/code.scss Normal file
View File

@@ -0,0 +1,31 @@
pre,
code {
font-family: "CMU Typewriter Text", monospace;
font-size: 0.75em;
font-style: normal !important;
}
a > code {
color: #90bcff;
}
code {
border: 1px solid rgb(150, 150, 150);
border-radius: 3px;
background-color: rgb(0, 0, 0);
padding: 0.15em 0.34em;
white-space: nowrap;
}
pre {
background: rgb(25, 25, 25);
border-radius: 7px;
padding: 1em;
code {
font-size: 1em;
border: 0;
background-color: transparent !important;
white-space: pre-wrap;
}
}

24
_sass/helpers.scss Normal file
View File

@@ -0,0 +1,24 @@
span,
p {
&.tab {
margin-left: 2em;
}
}
.nowrap {
white-space: nowrap;
}
.no-underline {
text-decoration: none;
}
.text-center {
text-align: center;
}
.callout-section {
border: solid white;
border-width: thin 0;
padding: 10px;
}

View File

@@ -1,25 +1,22 @@
@import "glitch";
@import "mixins";
@import "helpers";
@import "code";
::selection {
background: #606060;
color: white;
}
// Dark-mode selections
::selection,
::-moz-selection {
background: #606060;
color: white;
}
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
background: #444444;
color: #ffffff;
}
// All img tags will use the EXIF data to rotate images
img {
image-orientation: from-image;
}
html, body {
html,
body {
max-width: 100%;
max-height: 100%;
width: 100%;
@@ -35,7 +32,7 @@ html {
body {
padding: 0;
font-family: CMU Serif, serif;
font-family: "CMU Serif", serif;
line-height: 1.5;
background: #0e0e0e;
color: white;
@@ -58,7 +55,7 @@ header {
letter-spacing: 0.1em;
}
@media (max-width: 720px) {
@include for-size(tablet-portrait-up) {
header {
font-size: 3em;
}
@@ -84,7 +81,7 @@ blockquote:before {
aside.references:before {
font-size: 3em;
margin-top: -0.5rem;
font-family: Symbola, serif;
font-family: "Symbola", serif;
/* OPEN BOOK in text presentation */
content: "\1F4D6\FE0E";
@@ -124,42 +121,6 @@ dd {
margin-left: 2em;
}
pre,
code {
font-family: CMU Typewriter Text, monospace, monospace;
font-size: 0.75em;
font-style: normal !important;
}
.no-underline {
text-decoration: none;
}
a > code {
color: #90bcff;
}
code {
border: 1px solid rgb(150, 150, 150);
border-radius: 3px;
background-color: rgb(0, 0, 0);
padding: 0.15em 0.34em;
white-space: nowrap;
}
pre {
background: rgb(25, 25, 25);
border-radius: 7px;
padding: 1em;
code {
font-size: 1em;
border: 0;
background-color: transparent !important;
white-space: pre-wrap;
}
}
a,
hr {
color: white;
@@ -235,13 +196,13 @@ sup {
nav {
text-align: center;
font-family: CMU Typewriter Text, monospace, monospace;
font-family: "CMU Typewriter Text", monospace, monospace;
font-size: 1.25em;
color: #808080;
}
nav a {
a {
color: white;
}
}
.post_summary {
@@ -257,9 +218,7 @@ nav a {
border: thin solid white;
border-width: thin 0;
padding: 0.25em 0;
}
.post_date {
a {
text-decoration: none;
}
@@ -339,19 +298,8 @@ article {
}
}
.text-center {
text-align: center;
}
.callout-section {
border: solid white;
border-width: thin 0;
padding: 10px;
}
.build-revision {
font-family: CMU Typewriter Text, sans-serif;
font-family: "CMU Typewriter Text", sans-serif;
a {
color: #d2d2d2;
@@ -377,8 +325,7 @@ article {
}
span {
font-family: CMU Typewriter Text, sans-serif;
font-family: "CMU Typewriter Text", sans-serif;
a {
text-decoration: none;
@@ -387,13 +334,3 @@ article {
}
}
}
span, p {
&.tab {
margin-left: 2em;
}
}
.nowrap {
white-space: nowrap;
}

23
_sass/mixins.scss Normal file
View File

@@ -0,0 +1,23 @@
@mixin for-size($size) {
@if $size == phone-only {
@media (max-width: 599px) {
@content;
}
} @else if $size == tablet-portrait-up {
@media (min-width: 600px) {
@content;
}
} @else if $size == tablet-landscape-up {
@media (min-width: 900px) {
@content;
}
} @else if $size == desktop-up {
@media (min-width: 1200px) {
@content;
}
} @else if $size == big-desktop-up {
@media (min-width: 1800px) {
@content;
}
}
}