Break up reset and root styles into separate stylesheets and include them directly in baseof.html

This commit is contained in:
Eryn Wells 2022-09-07 08:46:02 -07:00
parent 295c61466c
commit 27154cdfc2
3 changed files with 155 additions and 35 deletions

View file

@ -5,7 +5,7 @@
<body>
{{ block "body" . }}
{{ block "header" . }}{{ end }}
<main>
<main class="{{ .Type }}">
{{ block "main" . }}{{ end }}
</main>
{{ partial "development/page_info.html" . }}
@ -23,6 +23,8 @@
}
</style>
{{ block "styles" . }}{{ end }}
<link rel="stylesheet" as="style" href="{{ `/styles/reset.css` | absURL }}">
<link rel="stylesheet" as="style" href="{{ `/styles/root.css` | absURL }}">
{{ if not hugo.IsProduction }}
<link rel="stylesheet" as="style" href="/styles/development.css">
{{ end }}

View file

@ -2,38 +2,13 @@
* Eryn Wells <eryn@erynwells.me>
*/
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-size: inherit;
font-weight: 700;
line-height: 1.2;
}
* { box-sizing: border-box; }
p {
margin: 0;
}
strong,
b {
font-weight: 500;
}
ul,
ol {
button, h1, h2, h3, h4, h5, h6, input, ol, ul, p, textarea {
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
table {
width: 100%;
border-spacing: 0;
@ -43,7 +18,6 @@ table {
button,
input,
textarea {
padding: 0;
font: inherit;
background: transparent;
border: 0;
@ -57,12 +31,6 @@ input[type='submit'] {
cursor: pointer;
}
input,
textarea {
padding: 0;
border: 0;
}
input:-webkit-autofill,
textarea:-webkit-autofill {
box-shadow: 0 0 0 6rem var(--white) inset;

150
static/styles/root.css Normal file
View file

@ -0,0 +1,150 @@
:root {
--lt-blue: rgb(69, 212, 243);
--mid-blue: rgb(26, 169, 239);
--dk-blue: rgb(63, 46, 231);
--purple: rgb(161, 49, 232);
--lilac: rgb(187, 121, 245);
--background-color: #fff;
--foreground-color: #000;
--font-family-body: Verdana, Helvetica, sans-serif;
--font-family-heading: Museo_Slab, Tahoma, sans-serif;
--font-family-site-heading: /*Krungthep,*/ Museo_Slab, Tahoma, sans-serif;
--font-size-min: 7px;
--font-size-max: 8px;
--content-width: 80rem;
}
@media (prefers-color-scheme: dark) {
:root {
--background-color: #000;
--foreground-color: #fff;
}
}
a {
color: var(--mid-blue);
text-decoration: none;
}
a:hover {
text-decoration: underline;
text-underline-offset: 0.12em;
}
a:visited { color: none; }
body {
font-size: 2rem;
line-height: 1.2;
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-family-heading);
margin: 0;
margin-block: 2rem 0.5rem;
padding: 0;
}
html {
background-color: var(--background-color);
color: var(--foreground-color);
font-family: var(--font-family-body);
font-size: clamp(var(--font-size-min), 1vw, var(--font-size-max));
}
main {
max-width: var(--content-width);
margin: 0 auto;
margin-block-start: 10rem;
}
p {
letter-spacing: 0.025em;
line-height: 1.25;
}
h1.site {
color: var(--mid-blue);
}
@supports (background-clip: text) {
h1.site {
background:
radial-gradient(circle at 20% 70%, var(--purple), transparent 40%),
radial-gradient(circle at 30% 30%, var(--lt-blue), var(--mid-blue) 20%, transparent 80%),
radial-gradient(ellipse at 95% 20%, var(--dk-blue), var(--mid-blue) 70%, transparent 80%),
radial-gradient(circle at 100% 100%, var(--purple), var(--lilac) 100%),
radial-gradient(circle at 45% 100%, var(--lilac), var(--purple) 60%),
radial-gradient(ellipse at 50% 50%, var(--dk-blue), transparent 80%);
background-clip: text;
color: transparent;
}
}
h1.site * { color: inherit; }
header.site {
display: flex;
position: fixed;
top: 0;
left: 0;
width: 100%;
}
header.site h1 {
font-family: var(--font-family-site-heading);
}
header.site .grid {
align-items: baseline;
display: grid;
gap: 0.5em;
grid-template-columns: max-content auto max-content;
width: var(--content-width);
}
header.site .platter {
background: var(--background-color);
border: 1px solid #dfdfdf;
border-radius: 12px;
box-shadow: 4px 5px 5px rgba(230, 230, 230, 0.5);
margin: 0 auto;
padding-inline: 3rem;
}
header.site .grid nav:first-of-type {
justify-content: start;
}
header.site .grid nav:last-of-type {
justify-content: end;
}
nav.site {
align-items: center;
display: flex;
font-size: max(1.5rem, 80%);
justify-content: start;
letter-spacing: 0.12em;
list-style: none;
text-transform: lowercase;
}
nav.site li {
display: block;
margin-inline-end: 0.5em;
}
nav.bulleted li:first-child::before {
content: "";
margin-inline-end: 0;
}
nav.bulleted li::before {
content: "•";
font-size: 60%;
opacity: 80%;
margin-inline-end: 0.5em;
}
p { margin-block-end: 1em; }
p:last-child { margin-block-end: 0; }