This commit is contained in:
Joe Carstairs
2024-05-19 10:18:45 +01:00
5 changed files with 40 additions and 7 deletions

View File

@@ -45,10 +45,12 @@
/** Light theme */ /** Light theme */
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
:root {
--colour-primary-fg: var(--colour-primary-20); --colour-primary-fg: var(--colour-primary-20);
--colour-primary-bg: var(--colour-primary-95); --colour-primary-bg: var(--colour-primary-95);
--colour-hyperlink: var(--colour-hyperlink-40); --colour-hyperlink: var(--colour-hyperlink-40);
} }
}
/** Base typography */ /** Base typography */
@@ -57,6 +59,9 @@ body {
color: var(--colour-primary-fg); color: var(--colour-primary-fg);
background-color: var(--colour-primary-bg); background-color: var(--colour-primary-bg);
line-height: 1.5; line-height: 1.5;
/* Geometric Humanist stack from https://modernfontstacks.com */
font-family: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
} }
small { small {

View File

@@ -1,8 +1,34 @@
.h-card { .h-card {
div:has(img) {
width: 6rem;
height: 6rem;
margin-inline: auto;
img { img {
width: 6rem; width: 6rem;
height: 6rem; height: 6rem;
border-radius: 1rem; border-radius: 1rem;
filter: contrast(1.25);
}
&::after {
/* Colour overlay */
background-color: var(--colour-primary-80);
opacity: 0.3;
/* Same size and shape as the img */
border-radius: 1rem;
width: 6rem;
height: 6rem;
/* Positioned on top of the img */
display: block;
position: relative;
top: -6rem;
/* A content value is needed to get the ::after to render */
content: '';
}
} }
} }
@@ -16,7 +42,7 @@
"empty heading" "empty heading"
"photo text"; "photo text";
img { div:has(img) {
grid-area: photo; grid-area: photo;
margin-block-start: var(--spacing-block-sm); margin-block-start: var(--spacing-block-sm);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -2,7 +2,9 @@
--- ---
<section class="h-card"> <section class="h-card">
<img class="u-photo" src="/images/headshot.jpg" height="256" width="256" /> <div>
<img class="u-photo" src="/images/headshot.webp" height="96" width="96" />
</div>
<header> <header>
<h1> <h1>