-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: wrap some of CSS in layers
remove unused CSS custom properties fix: use --base-color correctly
- Loading branch information
Eric Masiello
committed
Nov 27, 2023
1 parent
6988cf6
commit 8a6d07e
Showing
4 changed files
with
134 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,135 +1,138 @@ | ||
:root { | ||
--font-base: 'Source Sans Pro', sans-serif; | ||
--font-header: 'Lato', sans-serif; | ||
--font-body-weight-light: 300; | ||
--font-body-weight-medium: 400; | ||
--font-body-weight-bold: 600; | ||
--font-header-weight-medium: 400; | ||
--font-header-weight-bold: 700; | ||
--font-size-body: 0.875rem; | ||
--color-bg: #fff; | ||
--color-base: #424141; | ||
--color-muted: #787575; | ||
--color-brand: #c90044; | ||
--color-brand-invert: #36ffbb; | ||
--color-highlight: #5f2058; | ||
--color-link: rgba(201, 0, 68, 0.8); | ||
--color-logo: #3b3b3b; | ||
--color-gallery-border: rgba(212, 207, 209, 0.5); | ||
--color-gallery-border-highlight: #d4cfd1; | ||
--color-gallery-bg: #e0dcde; | ||
--content-max-width: 100rem; /* 1600px */ | ||
--h-space: 2.5rem; | ||
} | ||
|
||
html { | ||
box-sizing: border-box; | ||
background-color: var(--color-bg); | ||
font-family: var(--font-base); | ||
color: var(--color--base); | ||
font-size: 100%; | ||
@layer variables, base; | ||
|
||
@layer variables { | ||
:root { | ||
--font-base: 'Source Sans Pro', sans-serif; | ||
--font-header: 'Lato', sans-serif; | ||
--font-body-weight-light: 300; | ||
--font-body-weight-medium: 400; | ||
--font-body-weight-bold: 600; | ||
--font-header-weight-medium: 400; | ||
--font-header-weight-bold: 700; | ||
--font-size-body: 0.875rem; | ||
--color-bg: #fff; | ||
--color-base: #2d2d2d; | ||
--color-muted: #787575; | ||
--color-brand: #c90044; | ||
--color-brand-invert: #36ffbb; | ||
--color-highlight: #5f2058; | ||
--color-link: rgba(201, 0, 68, 0.8); | ||
--color-logo: #3b3b3b; | ||
--content-max-width: 100rem; /* 1600px */ | ||
--h-space: 2.5rem; | ||
} | ||
} | ||
|
||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: inherit; | ||
} | ||
@layer base { | ||
html { | ||
box-sizing: border-box; | ||
background-color: var(--color-bg); | ||
font-family: var(--font-base); | ||
color: var(--color-base); | ||
font-size: 100%; | ||
} | ||
|
||
code { | ||
font-family: monospace; | ||
background: var(--color-highlight); | ||
color: var(--color-bg); | ||
padding: 0.15em; | ||
font-size: 0.9em; | ||
} | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
font-size: var(--font-size-body); | ||
line-height: 1.4; | ||
font-weight: var(--font-body-weight-light); | ||
} | ||
code { | ||
font-family: monospace; | ||
background: var(--color-highlight); | ||
color: var(--color-bg); | ||
padding: 0.15em; | ||
font-size: 0.9em; | ||
} | ||
|
||
@media only screen and (min-width: 992px) { | ||
body { | ||
font-size: 0.9375rem; | ||
margin: 0; | ||
font-size: var(--font-size-body); | ||
line-height: 1.4; | ||
font-weight: var(--font-body-weight-light); | ||
} | ||
} | ||
|
||
@media only screen and (min-width: 1200px) { | ||
body { | ||
font-size: 1rem; | ||
@media only screen and (min-width: 992px) { | ||
body { | ||
font-size: 0.9375rem; | ||
} | ||
} | ||
} | ||
|
||
/* Smooth scrolling IF user doesn't have a preference due to motion sensitivities */ | ||
@media screen and (prefers-reduced-motion: no-preference) { | ||
html, | ||
body { | ||
scroll-behavior: smooth; | ||
@media only screen and (min-width: 1200px) { | ||
body { | ||
font-size: 1rem; | ||
} | ||
} | ||
} | ||
|
||
input, | ||
textarea, | ||
select, | ||
button { | ||
font-size: inherit; | ||
font-family: inherit; | ||
font-weight: inherit; | ||
} | ||
/* Smooth scrolling IF user doesn't have a preference due to motion sensitivities */ | ||
@media screen and (prefers-reduced-motion: no-preference) { | ||
html, | ||
body { | ||
scroll-behavior: smooth; | ||
} | ||
} | ||
|
||
input[type='button'], | ||
input[type='submit'], | ||
input[type='reset'], | ||
button { | ||
cursor: pointer; | ||
} | ||
input, | ||
textarea, | ||
select, | ||
button { | ||
font-size: inherit; | ||
font-family: inherit; | ||
font-weight: inherit; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-family: var(--font-header); | ||
font-weight: var(--font-header-weight-medium); | ||
line-height: 1.4; | ||
} | ||
input[type='button'], | ||
input[type='submit'], | ||
input[type='reset'], | ||
button { | ||
cursor: pointer; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
p { | ||
margin-block-start: 0; | ||
margin-block-end: 1rem; | ||
} | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-family: var(--font-header); | ||
font-weight: var(--font-header-weight-medium); | ||
line-height: 1.4; | ||
} | ||
|
||
a { | ||
background-color: transparent; | ||
color: var(--color-link); | ||
-webkit-tap-highlight-color: transparent; | ||
} | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
p { | ||
margin-block-start: 0; | ||
margin-block-end: 1rem; | ||
} | ||
|
||
a:focus { | ||
outline: 3px auto var(--color-brand); | ||
} | ||
a { | ||
background-color: transparent; | ||
color: var(--color-link); | ||
-webkit-tap-highlight-color: transparent; | ||
} | ||
|
||
img, | ||
svg { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
a:focus { | ||
outline: 3px auto var(--color-brand); | ||
} | ||
|
||
img { | ||
vertical-align: middle; | ||
border: 0; | ||
} | ||
img, | ||
svg { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
|
||
img { | ||
vertical-align: middle; | ||
border: 0; | ||
} | ||
|
||
blockquote { | ||
margin: 0; | ||
blockquote { | ||
margin: 0; | ||
} | ||
} |