Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce dark mode #28

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions _source/_assets/css/base/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@ body {
padding: 0;
position: relative;
overflow-x: hidden;
color: $color-black;
font-family: $serif-stack;
font-size: $font-base-small;
color: var(--color-text);
font-family: var(--serif-stack);
font-size: var(--font-base-small);
font-style: normal;
font-weight: 400;
line-height: 1;
background-color: var(--color-background);

@include media(large) {
font-size: $font-base-medium;
font-size: var(--font-base-medium);
}

@include media(x-large) {
font-size: $font-base-large;
font-size: var(--font-base-large);
}
}

a {
color: $color-black;
color: var(--color-text);
font-weight: 550;
margin: -.2rem;
padding: .2rem;
Expand All @@ -39,27 +40,27 @@ a {
text-decoration-width: 0.1rem;

&:visited {
color: $color-black;
color: var(--color-text);
}

@media(hover: hover) {

&:hover {
text-decoration-color: $color-accent;
text-decoration-color: var(--color-accent);
text-decoration-thickness: 0.2em;
text-decoration-width: 0.2em;
}
}

&:active {
color: $color-black;
color: var(--color-text);
}
}

h1, h2, h3 {
margin-top: 1.5em;
margin-bottom: 0.75em;
font-family: $sans-stack;
font-family: var(--sans-stack);
font-weight: 600;
letter-spacing: -.01em;
line-height: 1.1em;
Expand All @@ -69,19 +70,19 @@ h1, h2, h3 {

h1 {
margin-top: 2em;
font-size: $font-xxx-large;
font-size: var(--font-xxx-large);
font-weight: 700;
}

h2 {
margin-top: 2.5em;
font-size: $font-xx-large;
font-size: var(--font-xx-large);
text-align: center;
}

h3 {
margin-top: 2.5em;
font-size: $font-x-large;
font-size: var(--font-x-large);
font-weight: 500;
letter-spacing: 0.01em;
}
Expand Down Expand Up @@ -116,7 +117,7 @@ blockquote {
position: relative;
margin-bottom: 1.5em;
padding: 0 0 0 2em;
border-left: 2px solid $color-black;
border-left: 2px solid var(--color-text);
text-align: left;

&:before {
Expand Down Expand Up @@ -149,10 +150,10 @@ hr {

code,
pre {
font-family: $mono-stack;
font-family: var(--mono-stack);
line-height: 1.25;
padding: 0 0.1em;
background-color: $color-tint;
background-color: var(--color-tint);
direction: ltr;
text-align: left;
white-space: pre;
Expand All @@ -175,7 +176,7 @@ pre {
margin-top: 0;
margin-bottom: 2em;
font-weight: 400;
background: $color-tint;
background: var(--color-tint);

@include media(medium) {
margin: 0 0 2em 0;
Expand All @@ -190,7 +191,7 @@ pre {
bottom: 0;
right: 0;
width: 2em;
background: linear-gradient(to right, rgba($color-tint, 0), $color-tint);
background: linear-gradient(to right, rgba(var(--color-tint-rgb), 0), var(--color-tint));
}
}

Expand All @@ -215,12 +216,12 @@ table {
}

thead {
background-color: $color-tint;
font-family: $sans-stack;
background-color: var(--color-tint);
font-family: var(--sans-stack);
}

tr {
border-bottom: 0.125em solid $color-tint;
border-bottom: 0.125em solid var(--color-tint);
}

th,
Expand Down
71 changes: 49 additions & 22 deletions _source/_assets/css/base/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,56 @@
$column-width: 30em;
:root {
--column-width: 30em;

$serif-stack: 'Bitter', serif;
$sans-stack: 'Jost', sans-serif;
$mono-stack: 'RobotoMono', monospace;
--serif-stack: 'Bitter', serif;
--sans-stack: 'Jost', sans-serif;
--mono-stack: 'RobotoMono', monospace;

$font-base-small: 1.6em;
$font-base-medium: calc(1em + 0.55vw);
$font-base-large: 1.8em;
--font-base-small: 1.6em;
--font-base-medium: calc(1em + 0.55vw);
--font-base-large: 1.8em;

$font-xxx-small: 0.55em;
$font-xx-small: 0.65em;
$font-x-small: 0.75em;
$font-small: 0.85em;
$font-medium: 1em;
$font-large: 1.125em;
$font-x-large: 1.25em;
$font-xx-large: 1.75em;
$font-xxx-large: 2.25em;
$font-xxxx-large: 3em;
--font-xxx-small: 0.55em;
--font-xx-small: 0.65em;
--font-x-small: 0.75em;
--font-small: 0.85em;
--font-medium: 1em;
--font-large: 1.125em;
--font-x-large: 1.25em;
--font-xx-large: 1.75em;
--font-xxx-large: 2.25em;
--font-xxxx-large: 3em;

$color-white: #FFF;
$color-black: #000;
$color-accent: #FFE801;
$color-tint: #FBF7F0;
$color-brand: #E76057;
--color-white: #FFF;
--color-white-rgb: 255, 255, 255;
--color-black: #000;
--color-black-rgb: 0, 0, 0;
--color-accent: #FFE801;
--color-tint: #FBF7F0;
--color-tint-rgb: 251, 247, 240;
--color-brand: #E76057;

--color-text: var(--color-black);
--color-text-rgb: var(--color-black-rgb);
--color-background: var(--color-white);
--color-background-rgb: var(--color-white-rgb);
}

@media (prefers-color-scheme: dark) {
:root {
--color-accent: #cbab00;
--color-tint: #5f5e5b;
--color-brand: #FF6B61;

--color-off-white: #E0E0E0;
--color-off-white-rgb: 224, 224, 224;
--color-text: var(--color-off-white);
--color-text-rgb: var(--color-off-white-rgb);
--color-off-black: #2A2A2A;
--color-off-black-rgb: 42, 42, 42;
--color-background: var(--color-off-black);
--color-background-rgb: var(--color-off-black-rgb);
}
}

@mixin border-box {
-webkit-box-sizing: border-box;
Expand Down
2 changes: 1 addition & 1 deletion _source/_assets/css/components/_anchor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
float: left;
margin: 0 0 0 -1em;
padding: 0;
font-size: $font-x-small;
font-size: var(--font-x-small);
text-decoration: none;
opacity: 0.5;
}
Expand Down
12 changes: 6 additions & 6 deletions _source/_assets/css/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
transition: font-weight 0.1s ease, clip-path 0.2s ease, background-color 0.2s ease;
display: inline-block;
padding: 1em 1.5em;
color: $color-white;
font-family: $sans-stack;
color: var(--color-background);
font-family: var(--sans-stack);
text-decoration: none;
text-align: center;
line-height: normal;
-webkit-appearance: none;
background-color: $color-brand;
background-color: var(--color-brand);
border: 0;
box-shadow: none;
clip-path: polygon(5% 10%, 46% 1%, 46% 10%, 100% 0, 95% 90%, 31% 100%, 31% 90%, 0% 100%);

&:visited {
color: $color-white;
color: var(--color-background);
}

@media(hover: hover) {
&:hover {
color: $color-black;
background-color: $color-accent;
color: var(--color-text);
background-color: var(--color-accent);
cursor: pointer;
text-decoration: none;
font-weight: 800;
Expand Down
4 changes: 2 additions & 2 deletions _source/_assets/css/components/_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
.docs__screenshot {
max-width: 100%;
height: auto;
border: 0.2rem solid $color-white;
border: 0.2rem solid var(--color-background);
border-radius: 5px;
box-shadow: 0 0 1em rgba($color-black, 0.1);
box-shadow: 0 0 1em rgba(var(--color-text-rgb), 0.1);
}
6 changes: 6 additions & 0 deletions _source/_assets/css/components/_foot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@
}

}

.logo-basecamp,
.logo-hey {
height: 1.9em;
width: auto;
}
Loading