Refactor CSS for improved readability and structure; enhance header and footer styles

This commit is contained in:
Christian Galo 2025-03-20 02:28:05 -05:00
parent 0937a83905
commit 98f4c93d77
2 changed files with 77 additions and 23 deletions

View File

@ -3,7 +3,9 @@
https://www.joshwcomeau.com/css/custom-css-reset/ https://www.joshwcomeau.com/css/custom-css-reset/
*/ */
*, *::before, *::after { *,
*::before,
*::after {
box-sizing: border-box; box-sizing: border-box;
} }
@ -16,35 +18,57 @@ body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
img, picture, video, canvas, svg { img,
picture,
video,
canvas,
svg {
:root { :root {
/* Consider dark mode implementation later */ /* Consider dark mode implementation later */
color-scheme: light; color-scheme: light;
} }
display: block; display: block;
max-width: 100%; max-width: 100%;
} }
input, button, textarea, select { input,
button,
textarea,
select {
font: inherit; font: inherit;
} }
p, h1, h2, h3, h4, h5, h6 { p,
h1,
h2,
h3,
h4,
h5,
h6 {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
p { p {
text-wrap: pretty; text-wrap: pretty;
} }
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
text-wrap: balance; text-wrap: balance;
} }
#root, #__next { #root,
#__next {
isolation: isolate; isolation: isolate;
} }
/* Custom CSS for the Wikidarity theme */ /* Custom CSS for the Wikidarity theme */
/* TODO: Add variables */
:root { :root {
/* Consider dark mode implementation later */ /* Consider dark mode implementation later */
@ -61,7 +85,7 @@ body {
font-family: "RecVar", Helvetica, Arial, sans-serif; font-family: "RecVar", Helvetica, Arial, sans-serif;
max-width: 64rem; max-width: 64rem;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100svh;
padding: 2rem; padding: 2rem;
background-color: oklch(0.97 0 0); background-color: oklch(0.97 0 0);
transition: background-color 0.2s ease; transition: background-color 0.2s ease;
@ -70,7 +94,12 @@ body {
gap: 2rem; gap: 2rem;
} }
h1, h2, h3, h4, h5, h6 { h1,
h2,
h3,
h4,
h5,
h6 {
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
@ -114,25 +143,25 @@ a {
color: #00e; color: #00e;
text-decoration: underline transparent; text-decoration: underline transparent;
} }
a:hover { a:hover {
text-decoration-color: #00e; text-decoration-color: #00e;
} }
a:focus-visible { a:focus-visible {
text-decoration-color: #00e; text-decoration-color: #00e;
outline: 2px solid #00e; outline: 2px solid #00e;
outline-offset: 2px; outline-offset: 2px;
} }
a:visited { a:visited {
color: #551a8b; color: #551a8b;
} }
a:visited:hover { a:visited:hover {
text-decoration-color: #551a8b; text-decoration-color: #551a8b;
} }
a:visited:focus {
text-decoration-color: #551a8b;
outline: 2px solid #551a8b;
outline-offset: 2px;
}
a:visited:focus-visible { a:visited:focus-visible {
text-decoration-color: #551a8b; text-decoration-color: #551a8b;
outline: 2px solid #551a8b; outline: 2px solid #551a8b;
@ -142,7 +171,7 @@ a:visited:focus-visible {
blockquote { blockquote {
border-left: 2px solid oklch(0.145 0 0); border-left: 2px solid oklch(0.145 0 0);
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
background-color: oklch(0.9 0 0); background-color: oklch(0.922 0 0);
border-radius: 3px; border-radius: 3px;
} }
@ -154,21 +183,46 @@ code {
box-shadow: 0 1px 2px oklch(0.145 0 0); box-shadow: 0 1px 2px oklch(0.145 0 0);
} }
/* Header Styles */
header { header {
border-bottom: 1px solid oklch(0.145 0 0); border-bottom: 1px solid oklch(0.145 0 0);
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
.header-left {
justify-content: flex-start;
}
.header-right {
justify-content: flex-end;
}
h1 {
font-variation-settings: 'CASL' 0.5, 'MONO' 0.2, 'wght' 700;
font-size: 2rem;
line-height: 1.2;
padding-bottom: 0;
color: oklch(0.145 0 0);
a,
a:hover,
a:focus-visible,
a:visited,
a:visited:hover,
a:visited:focus-visible {
color: inherit;
}
a:hover, a:focus-visible, a:visited:hover, a:visited:focus-visible {
text-decoration-color: oklch(0.145 0 0);
}
}
} }
.header-left { /* Footer Styles */
justify-content: flex-start;
}
.header-right {
justify-content: flex-end;
}
footer { footer {
border-top: 1px solid oklch(0.145 0 0); border-top: 1px solid oklch(0.145 0 0);

View File

@ -2,6 +2,6 @@
<h1><a href="{{ .Site.BaseURL }}">{{ site.Title }}</a></h1> <h1><a href="{{ .Site.BaseURL }}">{{ site.Title }}</a></h1>
</div> </div>
<div class="header-right"> <div class="header-right">
<a href="https://cloud.wiki.cafe">Sign in</a> <a href="https://console.wiki.cafe">Sign in</a>
</div> </div>
<!-- {{ partial "menu.html" (dict "menuID" "main" "page" .) }} --> <!-- {{ partial "menu.html" (dict "menuID" "main" "page" .) }} -->