Redesign v2025.1

This commit is contained in:
Jonny Barnes 2025-12-11 17:17:01 +00:00
commit a8cb30456c
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
37 changed files with 1576 additions and 1174 deletions

View file

@ -1,8 +1,10 @@
@import url('variables.css');
@import url('fonts.css');
@import url('layout.css');
/* First thing we need to do is declare our cascade layers */
@layer reset, base, components;
@import url('reset.css');
@import url('colours.css');
@import url('code.css');
@import url('content.css');
@import url('layout.css');
@import url('header.css');
@import url('notes.css');
@import url('indieauth.css');
@import url('pagination.css');
@import url('theme-selector.css');

View file

@ -1,3 +0,0 @@
.hljs {
border-radius: .5rem;
}

View file

@ -1,28 +1,30 @@
body {
background-color: var(--color-secondary);
color: var(--color-primary);
}
@layer base {
:root {
color-scheme: light dark;
a {
color: var(--color-link);
--primary-hue: 307;
--clr-text: light-dark(
oklch(5% 0.1 var(--primary-hue)),
oklch(100% 0.1 var(--primary-hue))
);
--clr-background: light-dark(
oklch(100% 0.1 var(--primary-hue)),
oklch(15% 0.15 var(--primary-hue))
);
--clr-border: light-dark(
oklch(90% 0.2 var(--primary-hue)),
oklch(25% 0.1 var(--primary-hue))
);
&:visited {
color: var(--color-link-visited);
/* Adding snow fall colour whilst we are using it */
--clr-snow-fall: light-dark(
oklch(25% 0.15 var(--primary-hue)),
oklch(85% 0.2 var(--primary-hue))
);
}
&.auth:visited {
color: var(--color-link);
}
}
#site-header {
& a:visited {
color: var(--color-link);
}
& .rss-icon {
& svg {
color: var(--rss-color-link);
}
body {
background-color: var(--clr-background);
color: var(--clr-text);
}
}

View file

@ -1,64 +0,0 @@
@import url('h-card.css');
.h-entry {
border-inline-start: 1px solid var(--color-primary);
padding-inline-start: .5rem;
& .reply-to {
font-style: italic;
}
& .post-info {
& a {
text-decoration: none;
}
}
& .note-metadata {
display: flex;
flex-direction: row;
gap: 1rem;
& .replies,
& .likes,
& .reposts {
display: inline-flex;
flex-direction: row;
gap: .5rem;
align-items: center;
}
& .syndication-links {
flex-flow: row wrap;
& a {
text-decoration: none;
& svg {
width: 1rem;
height: 1rem;
}
}
}
}
}
.feather {
width: 24px;
height: 24px;
stroke: currentcolor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
}
.sr-only {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
position: absolute;
white-space: nowrap;
width: 1px;
}

View file

@ -1,17 +0,0 @@
body {
font-family: var(--font-family-body);
font-size: var(--font-size-md);
}
code {
font-family: var(--font-family-monospace);
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--font-family-headings);
}

View file

@ -1,32 +0,0 @@
.h-card {
& .hovercard {
display: none;
position: absolute;
z-index: 100;
padding: 1rem;
border-radius: 1rem;
box-shadow: 0 .5rem .5rem .5rem var(--color-primary-shadow);
background-color: var(--color-secondary);
width: fit-content;
transition: opacity 0.5s ease-in-out;
opacity: 0;
flex-direction: column;
gap: .5rem;
& .u-photo {
max-width: 6rem;
}
& .social-icon {
width: 1rem;
height: 1rem;
}
}
&:hover {
& .hovercard {
display: flex;
opacity: 1;
}
}
}

30
resources/css/header.css Normal file
View file

@ -0,0 +1,30 @@
@layer components {
body > header {
display: grid;
grid-template-columns: auto 1fr auto;
grid-template-rows: auto auto;
align-items: baseline;
gap: 1rem;
a {
text-decoration: none;
}
h1 {
margin: 0;
text-wrap: nowrap;
}
nav {
display: flex;
flex-direction: row;
gap: .5rem;
@media screen and (width <= 1100px) {
grid-row: 2;
grid-column: 1 / span 3;
flex-wrap: wrap;
}
}
}
}

View file

@ -1,13 +0,0 @@
.indieauth {
.error {
color: var(--color-danger);
background-color: var(--color-danger-shadow);
border: 1px solid var(--color-danger);
border-radius: .5rem;
display: flex;
padding-inline: 1rem;
padding-block: .5rem;
width: fit-content;
margin-block-end: 1rem;
}
}

View file

@ -1,55 +1,42 @@
.grid {
display: grid;
grid-template-columns: 5vw 1fr 5vw;
grid-template-rows: min-content 1fr min-content;
row-gap: 1rem;
}
@layer base {
:root {
--border-radius: 8px;
}
#site-header {
grid-column: 2 / 3;
grid-row: 1 / 2;
html {
font-size: 125%;
}
& .rss-icon {
& svg {
width: auto;
height: 1rem;
body {
display: grid;
grid-template-columns: 1fr min(80ch, 95vw) 1fr;
grid-template-rows: min-content 1fr min-content;
padding-inline: 4vw;
> header {
grid-column: 1/-1;
}
> main {
grid-column: 2/3;
}
> footer {
grid-column: 1/-1;
margin-block-start: 2ex;
search form {
display: flex;
flex-direction: row;
align-items: center;
gap: 1ex;
}
}
}
}
main {
grid-column: 2 / 3;
grid-row: 2 / 3;
}
.h-feed {
display: flex;
flex-direction: column;
gap: 2rem;
}
.h-entry {
& p:first-of-type,
& h1:first-of-type {
margin-block-start: 0;
}
}
.pagination {
margin-block-start: 1rem;
}
footer {
grid-column: 2 / 3;
grid-row: 3 / 4;
& .iwc-logo {
max-width: 85vw;
}
& .footer-actions {
.h-feed {
display: flex;
flex-direction: row;
gap: 1rem;
flex-direction: column;
gap: 2ex;
}
}

View file

@ -1,38 +1,25 @@
main {
& > .u-comment {
margin-block-start: 2rem;
margin-inline-start: 2rem;
border-inline-start: 1px solid var(--color-primary);
padding-inline-start: .5rem;
@layer components {
.h-feed {
.note {
display: flex;
flex-direction: column;
border: 1px solid var(--clr-border);
border-radius: var(--border-radius);
padding: 1ex 2ex;
& .mini-h-card {
display: inline-flex;
flex-direction: row;
align-items: baseline;
& .u-photo {
width: 2rem;
height: 2rem;
border-radius: 50%;
margin-block-end: 0.5rem;
.e-content > p:first-child {
margin-block-start: 0;
}
}
}
& .notes-subtitle {
font-size: 1.2rem;
font-weight: 600;
}
& .webmentions-author-list {
display: flex;
flex-flow: row wrap;
gap: 1rem;
& img {
width: 4rem;
height: 4rem;
border-radius: 50%;
.reply-to {
font-size: 85%;
margin-inline: 2ex;
padding-inline: 1ex;
border: 1px solid var(--clr-border);
border-bottom: none;
border-top-left-radius: var(--border-radius);
border-top-right-radius: var(--border-radius);
}
}
}

View file

@ -0,0 +1,14 @@
@layer components {
.pagination {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
div {
display: flex;
flex-direction: row;
gap: 1ex;
}
}
}

87
resources/css/reset.css Normal file
View file

@ -0,0 +1,87 @@
@layer reset {
/* Sourced from https://piccalil.li/blog/a-more-modern-css-reset/ */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Prevent font size inflation */
html {
/* stylelint-disable property-no-vendor-prefix */
-moz-text-size-adjust: none;
-webkit-text-size-adjust: none;
/* stylelint-enable property-no-vendor-prefix */
text-size-adjust: none;
}
/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
margin-block-end: 0;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
list-style: none;
}
/* Set core body defaults */
body {
line-height: 1.5;
}
/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
line-height: 1.1;
}
/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
text-wrap: balance;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
text-decoration-skip-ink: auto;
color: currentcolor;
}
/* Make images easier to work with */
img,
picture {
max-width: 100%;
display: block;
}
/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
font-family: inherit;
font-size: inherit;
}
/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
min-height: 10em;
}
/* Anything that has been anchored to should have extra scroll margin */
:target {
scroll-margin-block: 5ex;
}
/* Disable view transition animations for users who dont want them */
@media (prefers-reduced-motion) {
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
animation: none !important;
}
}
}

View file

@ -0,0 +1,96 @@
@layer components {
#theme-selector {
button {
appearance: none;
border: none;
background: none;
&:hover {
cursor: pointer;
}
}
/* This is the element with the [popover] attribute */
#theme-selector-dropdown {
position: absolute;
position-area: block-end span-inline-start;
margin: 0;
border: 2px solid var(--clr-border);
background-color: var(--clr-background);
color: var(--clr-text);
fieldset {
border: 0;
display: flex;
flex-direction: row;
gap: 1ch;
input {
display: none;
}
}
}
/*
* This is the element with the [popover] attribute
* Here we are styling the open and closing animations
*/
@media (prefers-reduced-motion: no-preference) {
#theme-selector-dropdown {
&:popover-open {
transform: translateY(0) scale(1);
opacity: 1;
/*
* Start styles for the opening transition.
* Added to :popover-open, but after the opened styles.
*/
@starting-style {
transform: translateY(30px) scale(0);
opacity: 0;
}
}
/*
* End styles for the closing transition.
*/
transform: translateY(0) scale(0);
opacity: 0;
/*
* Enumerate transitioning properties, including display and overlay.
*/
transition: transform, opacity, display allow-discrete, overlay allow-discrete;
transition-duration: 0.5s;
transform-origin: top right;
}
}
}
::view-transition-group(changing-theme) {
animation-duration: 1.25s;
}
::view-transition-new(changing-theme),
::view-transition-old(changing-theme) {
mix-blend-mode: normal;
}
::view-transition-new(changing-theme) {
animation-name: reveal;
}
::view-transition-old(changing-theme) {
animation: none;
}
@keyframes reveal {
from {
clip-path: polygon(-30% 0, -30% 0, -15% 100%, -10% 115%);
}
to {
clip-path: polygon(-30% 0, 130% 0, 115% 100%, -10% 115%);
}
}
}

View file

@ -1,25 +0,0 @@
:root {
/* Font Family */
--font-family-headings: 'Rockwell', 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif;
--font-family-body: 'Charter', 'Bitstream Charter', 'Sitka Text', 'Cambria', serif;
--font-family-monospace: ui-monospace, 'Cascadia Code', 'Source Code Pro', 'Menlo', 'Consolas', 'DejaVu Sans Mono', monospace;
/* Font Size */
--font-size-sm: 0.75rem; /* 12px */
--font-size-base: 1rem; /* 16px, base */
--font-size-md: 1.25rem; /* 20px */
--font-size-lg: 1.5rem; /* 24px */
--font-size-xl: 1.75rem; /* 28px */
--font-size-xxl: 2rem; /* 32px */
--font-size-xxxl: 2.25rem; /* 36px */
/* Colours */
--color-primary: oklch(36.8% 0.1 125.505deg);
--color-secondary: oklch(96.3% 0.1 125.505deg);
--color-link: oklch(48.09% 0.146 241.41deg);
--color-link-visited: oklch(70.44% 0.21 304.41deg);
--color-primary-shadow: oklch(19.56% 0.054 125.505deg / 40%);
--rss-color-link: oklch(67.59% 0.189 42.04deg);
--color-danger: oklch(64.41% 0.281 23.29deg);
--color-danger-shadow: oklch(64.41% 0.281 23.29deg / 10%);
}