From 7dcb0168a1e123aad5e7e8bff48982f26900eeb9 Mon Sep 17 00:00:00 2001 From: Devon Campbell Date: Mon, 28 Nov 2022 23:29:12 -0800 Subject: [PATCH] Style navigation --- assets/css/theme.css | 189 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 168 insertions(+), 21 deletions(-) diff --git a/assets/css/theme.css b/assets/css/theme.css index 3dcb19e..ed2a22b 100644 --- a/assets/css/theme.css +++ b/assets/css/theme.css @@ -10,10 +10,24 @@ --fancy-font-stack: BitBold, monospace; } +html { + box-sizing: border-box; +} +*, +*:before, +*:after { + box-sizing: inherit; +} +body > * { + grid-column: unset; +} body { background-image: url("data:image/svg+xml,"); background-attachment: fixed; font-size: 1.35rem; + grid-template-columns: 1fr; + justify-items: start; + column-gap: 3rem; } nav, @@ -26,6 +40,49 @@ h6 { font-family: var(--fancy-font-stack); } +img { + opacity: 1; +} + +body > nav { + align-self: start; + grid-row: 2; +} +nav { + position: relative; + margin-bottom: 2rem; + overflow: auto; +} +nav ul { + list-style-type: none; + margin: 0; + padding: 0; + display: flex; +} +nav li { + font-size: 2.5rem; + margin: 0 1rem; + white-space: nowrap; +} +nav li:first-of-type { + margin: 0; +} +nav a { + transition: 0.2s; +} +nav a, +nav a:visited { + text-decoration: none; + color: var(--text); + text-shadow: 3px 3px 0 black; +} +nav a[disabled] { + cursor: no-drop; +} +nav a:hover:not([disabled]) { + color: #fff; +} + h1 { font-size: 3.5rem; z-index: 1; @@ -34,40 +91,101 @@ h1 { text-shadow: 0.1em 0 black; } h1 + article { - margin-top: -0.9rem; + margin-top: -1.9rem; } .logo { - opacity: 1; + max-width: 100%; + margin: 2rem 1rem 3rem 2rem; +} +.logo img { width: 25rem; max-width: 100%; - margin-bottom: 3rem; +} +body > .logo { + grid-row: 1; } article { - position: relative; - border: none; - box-shadow: 0 0 20px 10px var(--accent); + border-radius: 0; +} +body > article { + grid-row: 4; + justify-self: stretch; } +body > article, +body > h1, +body > nav, +body > .logo { + grid-column: 1; +} +body > h1 { + grid-row: 3; +} +body > h1 { + margin: 1rem; +} +body > nav { + padding-left: 1rem; + width: 100%; +} +body > footer { + align-self: end; + grid-row: 5; + border: none; + color: var(--text); + margin-top: 2rem; +} +footer img { + width: 5rem; +} @media screen and (min-width: 50rem) { - article { - padding: 2rem; + body > h1 { + margin-left: 2rem; + } + body > nav { + padding-left: 2rem; } } -/* I'm using the Simple.css lightweight CSS framework. This allows me to use - the main background color from that framework (the CSS variable `--bg` and - use it only behind the article. */ -article::before { - content: ""; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: var(--bg); - opacity: 0.85; - z-index: -1; +@media screen and (min-width: 67rem) { + body { + grid-template-columns: minmax(45rem, 70rem) minmax(18rem, 1fr); + } + nav ul { + display: block; + } + nav li { + margin: 0; + } + body > nav { + grid-column: 2; + grid-row: 3; + width: auto; + overflow: unset; + position: sticky; + top: 0; + } + body > .logo { + grid-row: 1; + } + body > h1 { + grid-row: 2; + } + body > article { + grid-row: 3 / 5; + margin-bottom: 3rem; + } + body > footer { + align-self: end; + grid-column: 2; + grid-row: 4; + margin-bottom: 3rem; + } + nav a:hover:not([disabled]) { + text-shadow: 0 0 5px var(--accent), 0 0 25px var(--accent), + 0 0 50px var(--accent), 0 0 100px var(--accent); + } } h1, @@ -101,3 +219,32 @@ h6:hover .anchor { p:first-of-type { margin-top: 0; } + +.glow { + border: none; + box-shadow: 0 0 8px #fff, 0 0 20px 10px var(--accent); +} + +.bg { + position: relative; + padding: 1rem; +} +/* I'm using the Simple.css lightweight CSS framework. This allows me to use + the main background color from that framework (the CSS variable `--bg` and + use it only behind the article. */ +.bg::before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: var(--bg); + opacity: 0.85; + z-index: -1; +} +@media screen and (min-width: 50rem) { + .bg { + padding: 2rem; + } +}