129 lines
2.3 KiB
SCSS
129 lines
2.3 KiB
SCSS
$colors: (
|
|
background: #fff,
|
|
background-dark: #000,
|
|
primary: #000,
|
|
primary-dark: #fff
|
|
);
|
|
|
|
@mixin color($property, $varName) {
|
|
#{$property}: map-get($colors, $varName);
|
|
#{$property}: var(--#{$varName}, map-get($colors, $varName));
|
|
}
|
|
|
|
@mixin color-border($property, $val1, $val2, $varName) {
|
|
#{$property}: #{$val1} #{$val2} map-get($colors, $varName);
|
|
#{$property}: #{$val1} #{$val2} var(--#{$varName}, map-get($colors, $varName));
|
|
}
|
|
|
|
@mixin lightmode {
|
|
--background: #{map-get($colors, background)};
|
|
--primary: #{map-get($colors, primary)};
|
|
color: #000;
|
|
}
|
|
|
|
@mixin darkmode {
|
|
--background: #{map-get($colors, background-dark)};
|
|
--primary: #{map-get($colors, primary-dark)};
|
|
color: #fff;
|
|
}
|
|
|
|
html {
|
|
@include lightmode;
|
|
@media (prefers-color-scheme: dark) {
|
|
@include darkmode;
|
|
}
|
|
}
|
|
|
|
body {
|
|
/* Background color */
|
|
@include color(background, background);
|
|
/* Font settings */
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
line-height: 1.5;
|
|
/* Center body */
|
|
margin: 0 auto;
|
|
max-width: 750px;
|
|
padding: 10px;
|
|
/* Wrapping */
|
|
word-break: break-word;
|
|
overflow-wrap: break-word;
|
|
* {
|
|
@include color(color, primary);
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
|
|
header {
|
|
padding: 10px 0;
|
|
* {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
h1 a {
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
|
|
img {
|
|
width: 100%;
|
|
}
|
|
|
|
input, button {
|
|
@include color-border(border, 1px, solid, primary);
|
|
@include color(background, background);
|
|
@include color(color, primary);
|
|
padding: 5px 10px;
|
|
border-radius: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
blockquote {
|
|
@include color-border(border-left, 5px, solid, primary);
|
|
padding-left: 20px;
|
|
margin-left: 0;
|
|
}
|
|
|
|
pre {
|
|
padding: 10px;
|
|
@include color-border(border, 1px, solid, primary);
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
footer {
|
|
padding: 10px 0;
|
|
* {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
footer, .border-top {
|
|
@include color-border(border-top, 1px, solid, primary);
|
|
}
|
|
|
|
header, .border-bottom {
|
|
@include color-border(border-bottom, 1px, solid, primary);
|
|
}
|
|
|
|
.fake-p {
|
|
display: block;
|
|
margin-top: 1em;
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
.flex {
|
|
display: flex;
|
|
}
|
|
|
|
.hide {
|
|
display: none;
|
|
}
|
|
|
|
.full-width {
|
|
width: 100%;
|
|
}
|
|
|
|
.invert {
|
|
@include color(color, background);
|
|
@include color(background, primary);
|
|
} |