Organize SCSS: split implicit general styling and explicit. used classes
All checks were successful
/ build (pull_request) Successful in 36s

So differentiate between general stuff like variables, implicit general
document styling and classes, which need to be used explicitly.
This commit is contained in:
June 2024-01-29 03:59:55 +01:00
commit 9429366f49
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,38 @@
// Provide a container class, which limits the viewport depending on the screen
// width.
// Taken from PicoCSS, see here:
// https://github.com/picocss/pico/blob/v1.5.11/scss/layout/_container.scss
.container {
width: 100%;
margin-right: auto;
margin-left: auto;
padding-right: var(--spacing);
padding-left: var(--spacing);
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
max-width: map-get($viewports, "sm");
padding-right: 0;
padding-left: 0;
}
}
@if map-get($breakpoints, "md") {
@media (min-width: map-get($breakpoints, "md")) {
max-width: map-get($viewports, "md");
}
}
@if map-get($breakpoints, "lg") {
@media (min-width: map-get($breakpoints, "lg")) {
max-width: map-get($viewports, "lg");
}
}
@if map-get($breakpoints, "xl") {
@media (min-width: map-get($breakpoints, "xl")) {
max-width: map-get($viewports, "xl");
}
}
}

View file

@ -0,0 +1,48 @@
// A bunch of this is taken from PicoCSS, see here:
// https://github.com/picocss/pico/blob/v1.5.11/scss/themes/default/_styles.scss
:root {
// Use a (minimum) font size of 16px, since this seems to be a standard font
// size.
font-size: 16px;
// Explicitly set the Firefox default.
font-weight: 400;
// Line height of 1.5, see:
// https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#accessibility_concerns
line-height: 1.5;
font-family: sans-serif;
// Go up to 18px for the font size depending on the screen width.
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
font-size: 17px;
}
}
@if map-get($breakpoints, "md") {
@media (min-width: map-get($breakpoints, "md")) {
font-size: 18px;
}
}
h1, h2, h3, h4, h5, h6 {
// Explicitly set the Firefox default.
font-weight: 700;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.75rem;
}
h3 {
font-size: 1.5rem;
}
h4 {
font-size: 1.25rem;
}
h5 {
font-size: 1.125rem;
}
}

View file

@ -1,3 +1,8 @@
// General variables.
@import "variables.scss";
@import "container.scss";
@import "document-typography.scss";
// General implicit document styling.
@import "document/typography.scss";
// Classes to be used explicitly.
@import "classes/container.scss";