Compare commits

..
45 changed files with 2348 additions and 483 deletions

View file

@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v7
- uses: release-drafter/release-drafter@v6
with:
config-name: release-drafter.yaml
env:

View file

@ -1,7 +1,16 @@
repos:
- repo: https://github.com/awebdeveloper/pre-commit-stylelint
rev: "0.0.2"
hooks:
- id: stylelint
files: assets/css/.*\.css$
additional_dependencies:
- "stylelint@17.4.0"
- "stylelint-config-standard@40.0.0"
- repo: https://github.com/biomejs/pre-commit
rev: "v2.4.15"
rev: "v2.4.6"
hooks:
- id: biome-check
files: assets/js/.*\.js$
additional_dependencies:
- "@biomejs/biome@2.4.15"
- "@biomejs/biome@2.4.6"

1
.stylelintignore Normal file
View file

@ -0,0 +1 @@
libs/

24
.stylelintrc.yaml Normal file
View file

@ -0,0 +1,24 @@
extends:
- stylelint-config-standard
rules:
alpha-value-notation: number
block-no-empty: null
declaration-block-no-redundant-longhand-properties: null
declaration-empty-line-before: null
comment-empty-line-before:
- always
- except:
- first-nested
ignore:
- stylelint-commands
- after-comment
hue-degree-notation: number
import-notation: null
keyframes-name-pattern:
- "--.+"
- message: Keyframe name should be written as <dashed-ident>
media-feature-range-notation: prefix
no-descending-specificity: null
selector-class-pattern:
- "^[a-z0-9\\-\\_]+$"
- message: Selector should be written in lowercase with hyphens or underscore (selector-class-pattern)

View file

@ -23,7 +23,6 @@ Quickstart a new site with the Zen theme by using the [Zen demo repo as a templa
* [Installation](#installation)
* [Updating](#updating)
* [Run example site](#run-example-site)
* [Version 7.x](#version-7x)
* [Version 6.x](#version-6x)
* [Version 5.x](#version-5x)
* [Version 4.x](#version-4x)
@ -43,6 +42,7 @@ Quickstart a new site with the Zen theme by using the [Zen demo repo as a templa
* [Podcast](#podcast)
* [Shortcodes](#shortcodes)
* [Content security policy headers](#Content-security-policy-headers)
* [Use npm to lint CSS and JavaScript](#use-npm-to-lint-css-and-javascript)
* [Repository links](#repository-links)
* [Math typesetting with KaTeX](#math-typesetting-with-katex)
* [Getting help](#getting-help)
@ -58,7 +58,6 @@ Quickstart a new site with the Zen theme by using the [Zen demo repo as a templa
* Commands for linting of css and js
* Contact form (PHP)
* CSS grid and flex throughout
* Dark and light mode
* HTML5
* Hugo Pipes for images, js and css
* Math typesetting with KaTeX
@ -91,7 +90,7 @@ From the root of your site:
hugo mod init github.com/me/my-site
```
Then set the "theme" setting to "github.com/frjo/hugo-theme-zen/v7".
Then set the "theme" setting to "github.com/frjo/hugo-theme-zen/v6".
From the root of your site:
@ -150,17 +149,6 @@ From the root of `themes/zen/exampleSite`:
hugo server --themesDir ../..
```
## Version 7.x 2026-05-28
* Using color-scheme and light-dark() to implement dark mode.
* Add colorScheme param to optionally lock to light/dark.
* Lint css with biome, remove stylelint.
* Move header and footer styles to base.
* Remove node completely, replaced by pre-commit and biome.
### Upgrade to 7.x
Redo your colour settings to make it work well in dark mode or set `colorScheme: "light"` to lock your site to light mode.
## Version 6.x 2026-03-10
@ -257,8 +245,8 @@ Redo your colour settings to make it work well in dark mode or set `colorScheme:
Performance should be excellent.
* Minimal and compliant HTML5
* Styles 28 kB (8 kB when gzipped)
* JavaScript 6 kB (with everything active, otherwise near zero)
* Styles 23,2 kB (6,7 kB when gzipped)
* JavaScript 1 kB (with only mobile menu active, 4 Kb with all features active)
* All scripts loaded in head with "defer"
* Optimised for HTTP/2
@ -304,7 +292,6 @@ params:
- section2 # in the <schema.org> `JSON+LD` in the page's `<head>`.
- section3 # This theme requires Hugo `v0.109.0` or higher to
# generate the `BreadcrumbListing`.
colorScheme: "light" # "light/dark" to lock, omit for user system preference.
cookieConsent: true # Show cookie consent form, default false.
contact: "info@example.org"
dateformat: "" # Set the date format, default to "2 January, 2006"
@ -316,6 +303,7 @@ params:
image: "" # Relative path to site image in JSON-LD, no leading slash.
imageMaxWidth: "" # Max width for images added via figure shortcode.
internalPagination: true # Use Hugo's internal pagination template, default false.
jquery: true # Add jQuery, default false.
languageDir: "" # Set ltr or rtl, defaults to ltr.
logo: false # Turn off the logo, defaults to true.
logoPath: # Relative path to site logo, defaults to "images/logo.png", no leading slash.
@ -341,6 +329,7 @@ params:
siteName: false # Hide the site name (visually-hidden), default true.
submitted: true # Show author and date information for a post.
themeColor: # Hex color value, used in meta tags, default "#ffffff".
umbrella: true # Add Umbrella JS, default false.
podcast:
title: # * Feed title, defaults to site title (iTunes).
@ -385,7 +374,7 @@ They are found in the theme `assets/css/_colors.css` and `assets/css/_variables.
In most cases you likely only need to override a few values and then it is easier to set these in the custom css files.
Root `assets/css/_custom.css`: Loaded last so use it to override css variables and add any custom styles you need.
Root `assets/css/_custom.css`: Loaded last so use to override css variables and add any custom styles you need.
### Logo
@ -401,11 +390,13 @@ Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) t
The theme will autodetect them and add the needed code.
### Dark and light mode
### Head and footer partials
Colors are set with the css function `light-dark()`. The first colour is used in light mode and the other colour is used in dark mode. See `assets/css/_colors.css`.
If you create partials named `head/extra.html` and/or `footer.html` they will be used. They do not exist or are empty in the theme but are supported as a convenience.
Use the param `colorScheme` to lock your site to either light or dark mode. By default the mode will follow the users system preferences.
Content in the "head/extra" partial will be added to the end of the "head" tag, perhaps some extra css or javascript.
Content in the "footer" partial will replace all the default content in the "footer" tag.
### Layouts
@ -441,6 +432,10 @@ There is an `assets/css/_custom.css` file meant for your custom styles. Copy it
The default styles in `assets/css/_zen.css` are boring but functional. You can easily override them completely by placing an empty file named "_zen.css" in root assets/css directory.
The css files are by default built for production, compressed with fingerprint.
By setting the Hugo environment variable to "development" (default when running `hugo server`) they will instead be nested with sourcemaps.
## Render hook templates
@ -840,6 +835,27 @@ The **content** that should be wrapped. Some more content.
Includes tracking code for Matomo or Google in a way that supports Content security policy headers. Read more in my blog post [Content security policy headers when using Matomo or Google analytics](https://xdeb.org/post/2020/01/14/content-security-policy-headers-when-using-matomo-or-google-analytics/).
## Use npm to lint CSS and JavaScript
* Lint your CSS using stylelint.
* Lint your JavaScript using biome.
* Can lint files in the theme as well as the project assets directory.
Set up your front-end development build tools:
1. Install Node.js and npm, the Node.js package manager.
2. The package.json file in your new sub-theme contains the versions of all the
Node.js software you need. To install them run:
npm install
3. Run the following commands to lint your theme and projects CSS and JavaScript code.
npm run lint-theme
npm run lint-project
nmp run lint (project + theme)
## Repository links
Add view and edit repo links on your post. Activates when you add repository settings, see example for GitHub below. See more in the partial `repository-links.html`.

View file

@ -1,152 +1,97 @@
/* biome-ignore-all format: aligned columns for readability */
/* Theme colours. */
/* Override css variables in "assets/css/_custom.css" */
:root {
/* Brand colours. */
--color-brand: var(--color-grey-900);
--color-brand-alt: var(--color-grey-500);
/* Brand variations */
--color-brand-900: oklch(from var(--color-brand) calc(l - 0.5) c h);
--color-brand-800: oklch(from var(--color-brand) calc(l - 0.4) c h);
--color-brand-700: oklch(from var(--color-brand) calc(l - 0.3) c h);
--color-brand-600: oklch(from var(--color-brand) calc(l - 0.2) c h);
--color-brand-500: oklch(from var(--color-brand) calc(l - 0.1) c h);
--color-brand-400: oklch(from var(--color-brand) l c h);
--color-brand-300: oklch(from var(--color-brand) calc(l + 0.1) c h);
--color-brand-200: oklch(from var(--color-brand) calc(l + 0.2) c h);
--color-brand-100: oklch(from var(--color-brand) calc(l + 0.3) c h);
/* Brand alt variations */
--color-brand-alt-900: oklch(from var(--color-brand-alt) calc(l - 0.5) c h);
--color-brand-alt-800: oklch(from var(--color-brand-alt) calc(l - 0.4) c h);
--color-brand-alt-700: oklch(from var(--color-brand-alt) calc(l - 0.3) c h);
--color-brand-alt-600: oklch(from var(--color-brand-alt) calc(l - 0.2) c h);
--color-brand-alt-500: oklch(from var(--color-brand-alt) calc(l - 0.1) c h);
--color-brand-alt-400: oklch(from var(--color-brand-alt) l c h);
--color-brand-alt-300: oklch(from var(--color-brand-alt) calc(l + 0.1) c h);
--color-brand-alt-200: oklch(from var(--color-brand-alt) calc(l + 0.2) c h);
--color-brand-alt-100: oklch(from var(--color-brand-alt) calc(l + 0.3) c h);
/* Base colours. */
--color-black: oklch(1% 0.01 0);
--color-grey-900: oklch(21% 0.01 0);
--color-grey-800: oklch(28% 0.01 0);
--color-grey-700: oklch(37% 0.01 0);
--color-grey-600: oklch(45% 0.01 0);
--color-grey-500: oklch(55% 0.01 0);
--color-grey-400: oklch(71% 0.01 0);
--color-grey-300: oklch(87% 0.01 0);
--color-grey-200: oklch(93% 0.01 0);
--color-nearblack: oklch(25% 0.01 0);
--color-grey-700: oklch(38% 0 0);
--color-grey-600: oklch(49% 0 0);
--color-grey-500: oklch(60% 0 0);
--color-grey-400: oklch(71% 0 0);
--color-grey-300: oklch(80% 0 0);
--color-grey-200: oklch(89% 0 0);
--color-grey-100: oklch(95% 0 0);
--color-white: oklch(99% 0 0);
--color-nearwhite: oklch(98% 0 0);
--color-white: oklch(100% 0 0);
--color-red: oklch(65% 0.2 24);
--color-yellow: oklch(65% 0.12 80);
--color-green: oklch(65% 0.19 138);
--color-blue: oklch(65% 0.16 247);
/* Transparent colours. */
--color-black-90: oklch(1% 0.01 0 / 0.9);
--color-black-80: oklch(1% 0.01 0 / 0.8);
--color-black-70: oklch(1% 0.01 0 / 0.7);
--color-black-60: oklch(1% 0.01 0 / 0.6);
--color-black-50: oklch(1% 0.01 0 / 0.5);
--color-black-40: oklch(1% 0.01 0 / 0.4);
--color-black-30: oklch(1% 0.01 0 / 0.3);
--color-black-20: oklch(1% 0.01 0 / 0.2);
--color-black-10: oklch(1% 0.01 0 / 0.1);
--color-white-20: oklch(99% 0 0 / 0.2);
--color-white-10: oklch(99% 0 0 / 0.1);
--color-black-60: oklch(0% 0 0 / 0.6);
--color-black-40: oklch(0% 0 0 / 0.4);
--color-black-20: oklch(0% 0 0 / 0.2);
--color-black-10: oklch(0% 0 0 / 0.1);
--color-white-20: oklch(100% 0 0 / 0.2);
--color-white-10: oklch(100% 0 0 / 0.1);
/* Brand colours. */
--color-brand: var(--color-nearblack);
--color-brand-alt: var(--color-grey-500);
--color-brand-light: var(--color-grey-300);
--color-brand-dark: var(--color-grey-700);
/* Text colours. */
--color-text: light-dark(var(--color-black), var(--color-white));
--color-text-bg: light-dark(var(--color-white), var(--color-black));
--color-text-meta: light-dark(var(--color-grey-600), var(--color-grey-300));
--color-headings: light-dark(var(--color-grey-900), var(--color-grey-100));
--color-code: light-dark(var(--color-grey-900), var(--color-grey-100));
--color-text: var(--color-black);
--color-text-bg: var(--color-white);
--color-text-meta: var(--color-grey-600);
--color-headings: var(--color-nearblack);
--color-code: var(--color-nearblack);
/* Link colours. */
--color-link: light-dark(var(--color-brand-500), var(--color-grey-100));
--color-link-visited: light-dark(var(--color-brand-500), var(--color-grey-100));
--color-link-hover: light-dark(var(--color-brand-200), var(--color-grey-300));
--color-link-active: light-dark(var(--color-red), var(--color-red));
--color-link: var(--color-brand);
--color-link-visited: var(--color-brand);
--color-link-hover: var(--color-brand-alt);
--color-link-active: var(--color-red);
--color-link-inverted: var(--color-white);
--color-link-visited-inverted: var(--color-white);
--color-link-hover-inverted: var(--color-white);
--color-link-active-inverted: var(--color-red);
/* Button colours. */
--color-button: light-dark(var(--color-brand-400), var(--color-brand-100));
--color-button-text: light-dark(var(--color-white), var(--color-white));
--color-button-hover: light-dark(var(--color-brand-200), var(--color-brand-300));
--color-button-text-hover: light-dark(var(--color-white), var(--color-white));
/* Disabled colours. */
--color-disabled: light-dark(var(--color-grey-400), var(--color-grey-600));
--color-disabled-alt: light-dark(var(--color-grey-100), var(--color-grey-800));
--color-button: var(--color-brand);
--color-button-hover: var(--color-brand-alt);
--color-button-text: var(--color-white);
--color-button-text-hover: var(--color-white);
--color-button-disabled: var(--color-grey-400);
/* Border colours. */
--color-border: light-dark(var(--color-brand-400), var(--color-brand-200));
--color-border-light: light-dark(var(--color-brand-200), var(--color-brand-100));
--color-border-dark: light-dark(var(--color-brand-600), var(--color-brand-300));
--color-border: var(--color-brand);
--color-border-light: var(--color-brand-light);
--color-border-dark: var(--color-brand-dark);
/* Background colours. */
--color-body-bg: light-dark(var(--color-white), var(--color-black));
--color-page-bg: light-dark(transparent, transparent);
--color-header-bg: light-dark(transparent, transparent);
--color-footer-bg: light-dark(transparent, transparent);
--color-backdrop: light-dark(var(--color-black-60), var(--color-black-80));
--color-header-bg: var(--color-white);
--color-body-bg: var(--color-white);
--color-footer-bg: var(--color-white);
--color-backdrop: var(--color-grey-100);
/* Mobil menu colours. */
--color-mobile-menu: light-dark(var(--color-white), var(--color-brand-400));
--color-mobile-menu-cover: light-dark(var(--color-black-20), var(--color-black-20));
--color-mobile-menu: var(--color-brand);
--color-mobile-menu-cover: var(--color-black-20);
/* Form colours. */
--color-accent: light-dark(var(--color-brand-400), var(--color-brand-200));
--color-accent: var(--color-brand);
/* Row (e.g. in table) colours. */
--color-row-header: light-dark(transparent, transparent);
--color-row-odd: light-dark(var(--color-grey-100), var(--color-grey-900));
--color-row-even: light-dark(transparent, transparent);
/* Highlight colours. */
--color-highlight: light-dark(var(--color-brand-400), var(--color-brand-100));
--color-mark-highlight: light-dark(var(--color-red), var(--color-red));
--color-row-header: transparent;
--color-row-odd: var(--color-nearwhite);
--color-row-even: transparent;
/* Status colours. */
--color-info: var(--color-blue);
--color-success: var(--color-green);
--color-info-bg: oklch(from var(--color-blue) 100% 0.03 h);
--color-success: var(--color-green);
--color-success-bg: oklch(from var(--color-green) 100% 0.03 h);
--color-warning: var(--color-yellow);
--color-warning-bg: oklch(from var(--color-yellow) 100% 0.03 h);
--color-error: var(--color-red);
--color-error-bg: oklch(from var(--color-red) 100% 0.03 h);
/* Follow user system dark/light setting. */
color-scheme: light dark;
/* Initialize the theme variable */
--theme: light;
@media (prefers-color-scheme: dark) {
--theme: dark;
}
}
[data-theme="light"] {
color-scheme: light;
}
[data-theme="dark"] {
color-scheme: dark;
}
@container style(--theme: light) {
[data-theme="inverted"] {
color-scheme: dark;
}
}
@container style(--theme: dark) {
[data-theme="inverted"] {
color-scheme: light;
}
/* Highlight colours. */
--color-highlight: var(--color-brand-alt);
--color-mark-highlight: var(--color-red);
}

View file

@ -1,5 +1,3 @@
/* biome-ignore-all format: aligned columns for readability */
:root {
/* Set theme css variables.
Override css variables in "assets/css/_custom.css" */
@ -41,6 +39,8 @@
monospace) hints at what type of font to use if the web browser doesn't
find any of the fonts in the list. */
/* stylelint-disable value-keyword-case */
/* Emojis font stack. Add to end of other stacks when needed. */
--emojis: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
@ -69,6 +69,7 @@
/* Monospace font stacks. */
--ui-monospace: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
/* stylelint-enable value-keyword-case */
/* Font family. */
--ff-body: var(--ui-serif);

View file

@ -2,6 +2,14 @@
/* Page */
body {
background-color: var(--color-backdrop);
}
.page {
background-color: var(--color-body-bg);
}
.footer {
border-block-start: 2px solid var(--color-border);
}
@ -81,7 +89,7 @@ aside {
article {
.submitted,
.tags {
@media (width >= 666px) {
@media (min-width: 666px) {
display: inline-block;
padding-inline-end: 1rem;
}
@ -170,7 +178,7 @@ article {
border: unset;
text-shadow: unset;
font-size: var(--fs-l);
color: var(--color-border-light);
color: var(--color-border);
rotate: 90deg;
cursor: pointer;
@ -186,22 +194,12 @@ article {
}
.flash-item {
--color-flash: var(--color-warning);
--color-flash-bg: light-dark(
oklch(from var(--color-flash) 100% 0.03 h),
oklch(from var(--color-flash) calc(l - 0.3) c h)
);
--color-flash-border: light-dark(
oklch(from var(--color-flash) calc(l + 0.2) c h),
oklch(from var(--color-flash) calc(l - 0.07) c h)
);
animation: --flash 500ms ease-in-out 1ms;
}
@keyframes --flash {
50% {
border-color: var(--color-flash-border);
background-color: var(--color-flash-bg);
border-color: var(--color-warning);
background-color: var(--color-warning-bg);
}
}

View file

@ -1,31 +1,21 @@
/* Document */
html {
/* Set base font size in percent. */
font-size: calc(var(--base-font-size) / 16 * 100%);
}
body {
/* Change the default font family in all browsers. */
font-family: var(--ff-body);
/* Correct the line height in all browsers. */
line-height: var(--base-line-height);
/* Set base font size in percent. */
font-size: calc(var(--base-font-size) / 16 * 100%);
/* Set text colour. */
color: var(--color-text);
}
body {
/* Correct the line height in all browsers. */
line-height: var(--base-line-height);
/* Accent colour for forms. */
accent-color: var(--color-accent);
/* Set background colour. */
background-color: var(--color-body-bg);
}
.page {
background-color: var(--color-page-bg);
}
::backdrop {
background-color: var(--color-backdrop);
}

View file

@ -16,7 +16,7 @@ label {
/* Display as block if before input. */
&:has(+ input),
&:has(+ textarea) {
&:has(+ textarea){
display: block;
}
@ -32,21 +32,10 @@ label {
/* Valid and invalid state. */
input,
textarea {
--color-input: currentColor;
--color-input-bg: light-dark(
oklch(from var(--color-input) 100% 0.03 h),
oklch(from var(--color-input) calc(l - 0.4) c h)
);
--color-input-border: light-dark(
oklch(from var(--color-input) calc(l + 0.2) c h),
oklch(from var(--color-input) calc(l - 0.07) c h)
);
&:user-valid {
--color-input: var(--color-success);
border-color: var(--color-input-border);
border-color: var(--color-success);
border-style: solid;
background-color: var(--color-input-bg);
background-color: var(--color-success-bg);
}
&:focus:user-valid {
@ -54,16 +43,14 @@ textarea {
}
&:user-invalid {
--color-input: var(--color-error);
border-color: var(--color-input-border);
border-color: var(--color-error);
border-style: solid;
background-color: var(--color-input-bg);
background-color: var(--color-error-bg);
}
&:focus:user-invalid {
--color-input: var(--color-warning);
border-color: transparent;
background-color: var(--color-input-bg);
background-color: var(--color-warning-bg);
}
}

View file

@ -8,7 +8,7 @@ h3,
h4,
h5,
h6 {
margin-block: 1.5em 0.5em;
margin-block: 1.5em .5em;
color: var(--color-headings);
font-family: var(--ff-headings);
font-weight: var(--fw-headings);
@ -17,7 +17,7 @@ h6 {
/* Smaller margin when a headeing is right after another heading. */
& + & {
margin-block-start: 0.75em;
margin-block-start: .75em;
}
/* Set max text line width in main for readability. */
@ -31,17 +31,17 @@ h1 {
margin-block-start: var(--spacing-m);
margin-block-end: var(--spacing-xs);
font-size: var(--fs-xxl);
letter-spacing: -0.01em;
letter-spacing: -.01em;
}
h2 {
font-size: var(--fs-xl);
letter-spacing: -0.01em;
letter-spacing: -.01em;
}
h3 {
font-size: var(--fs-l);
letter-spacing: -0.01em;
letter-spacing: -.01em;
}
h4 {

View file

@ -3,9 +3,9 @@
figure,
img {
&.image {
--image-padding: 0.75rem;
--image-padding: .75rem;
@media (width >= 666px) {
@media (min-width: 666px) {
&.center {
margin-inline: auto;
}
@ -44,7 +44,7 @@ figure {
/* Nicer text wrap, e.g. no lone word on last line. */
text-wrap: pretty;
@media (width >= 666px) {
@media (min-width: 666px) {
padding-block-start: 0;
}
@ -53,7 +53,7 @@ figure {
}
}
@media (width >= 666px) {
@media (min-width: 666px) {
inline-size: fit-content;
&.left {

View file

@ -55,3 +55,25 @@ a:active {
}
}
}
/* Inverted links, for dark backgrounds. */
.link-inverted {
a {
&:link {
color: var(--color-link-inverted);
}
&:visited {
color: var(--color-link-visited-inverted);
}
&:hover,
&:focus {
color: var(--color-link-hover-inverted);
}
&:active {
color: var(--color-link-active-inverted);
}
}
}

View file

@ -1,19 +1,24 @@
/* Anchor */
/* TODO: Implement anchor-positioning when uptake is good. */
.anchor {
--anchor-gap: 0.5rem;
--anchor-opacity: 0.4;
--anchor-gap: .5rem;
--anchor-opacity: .4;
& > a {
display: grid;
grid-template-columns: auto auto;
justify-content: start;
align-items: baseline;
gap: var(--anchor-gap);
a {
opacity: 0;
text-decoration: none;
padding-inline-start: var(--anchor-gap);
width: fit-content;
}
&:has(:focus-visible),
&:hover {
& > a {
a {
opacity: var(--anchor-opacity);
&:focus-visible,
@ -22,8 +27,8 @@
}
}
}
}
svg {
display: inline;
}
p:has(+ .anchor) {
margin-block-end: 0;
}

View file

@ -33,3 +33,32 @@
.box--gutter {
padding-inline: var(--gutters);
}
.box--inverted {
background: var(--color-border);
color: var(--color-text-bg);
/* Make sure headings etc. also gets inverted. */
* {
color: var(--color-text-bg);
}
a {
&:link {
color: var(--color-link-inverted);
}
&:visited {
color: var(--color-link-visited-inverted);
}
&:hover,
&:focus {
color: var(--color-link-hover-inverted);
}
&:active {
color: var(--color-link-active-inverted);
}
}
}

View file

@ -1,3 +1,5 @@
/* stylelint-disable no-duplicate-selectors */
/* Button */
.button,
@ -9,13 +11,12 @@
text-decoration: none;
text-align: center;
width: fit-content;
padding: 0.5rem 1rem;
text-box-trim: trim-both;
text-box-edge: cap alphabetic;
padding: .2rem 1rem;
/* Improve usability and consistency of cursor style between image-type `input` and others. */
cursor: pointer;
color: var(--color-button-text);
text-shadow: var(--color-button) 0 1px 0;
background: linear-gradient(var(--color-button), var(--color-button-hover));
border: 1px solid var(--color-button-hover);
border-radius: var(--radius-s);
@ -26,6 +27,7 @@
/* Override any link underlines and color changes. */
text-decoration: none;
color: var(--color-button-text-hover);
text-shadow: var(--color-button-hover) 0 1px 0;
background: linear-gradient(var(--color-button-hover), var(--color-button));
}
@ -36,7 +38,7 @@
.button--small {
font-size: var(--fs-xs);
padding: 0.35rem 0.5rem;
padding: .2rem .75rem;
}
.button--alt {
@ -56,49 +58,12 @@
background: var(--color-button-text);
}
.button--accept,
.button--decline,
.button--delete {
--color-button: currentColor;
--color-button-text: light-dark(
oklch(from var(--color-button) l c h),
oklch(from var(--color-button) 100% 0.03 h)
);
--color-button-bg: light-dark(
oklch(from var(--color-button) 100% 0.03 h),
oklch(from var(--color-button) calc(l - 0.3) c h)
);
--color-button-border: light-dark(
oklch(from var(--color-button) calc(l + 0.2) c h),
oklch(from var(--color-button) calc(l - 0.07) c h)
);
--color-button-hover: light-dark(
oklch(from var(--color-button) 90% 0.03 h),
oklch(from var(--color-button) calc(l - 0.6) c h)
);
color: var(--color-button-text);
background: linear-gradient(var(--color-button-bg), var(--color-button-hover));
border-color: var(--color-button-border);
&:hover,
&:focus-visible,
&:active {
color: var(--color-button-text);
background: linear-gradient(var(--color-button-hover), var(--color-button-bg));
}
}
.button--accept {
--color-button: var(--color-success);
border-color: var(--color-success);
}
.button--decline {
--color-button: var(--color-warning);
}
.button--delete {
--color-button: var(--color-error);
border-color: var(--color-warning);
}
/* The disabled variation should always go last, so that it overrides any
@ -107,19 +72,18 @@ other variations. */
[type='button'],
[type='submit'] {
&:disabled {
color: var(--color-disabled);
background-color: var(--color-disabled-alt);
border: 1px solid var(--color-disabled);
background-color: var(--color-grey-200);
border: 1px solid var(--color-button-disabled);
background-image: none;
text-shadow: none;
cursor: default;
color: var(--color-button-disabled);
&:hover,
&:focus,
&:active {
/* Override any link underlines and color changes. */
color: var(--color-disabled);
background-color: var(--color-disabled-alt);
color: var(--color-button-disabled);
text-decoration: none;
}
}
@ -134,10 +98,10 @@ textarea {
}
/* For forms on mobile with single field add space between it and the submit button. */
@media (width >= 666px) {
@media (min-width: 666px) {
input:only-of-type {
&:has(+ [type='submit']) {
margin-inline-end: 0.5rem;
margin-inline-end: .5rem;
}
}
}

View file

@ -42,3 +42,27 @@ A simple cards style. */
.card--gutter {
padding-inline: var(--gutters);
}
.card--inverted {
background: var(--color-border);
color: var(--color-text-bg);
a {
&:link {
color: var(--color-link-inverted);
}
&:visited {
color: var(--color-link-visited-inverted);
}
&:hover,
&:focus {
color: var(--color-link-hover-inverted);
}
&:active {
color: var(--color-link-active-inverted);
}
}
}

View file

@ -1,40 +1,25 @@
/* Cookieconsent */
.cookieconsent {
--color-cookieconsent: var(--color-warning);
--color-cookieconsent-text: light-dark(
oklch(from var(--color-cookieconsent) l c h),
oklch(from var(--color-cookieconsent) 100% 0.03 h)
);
--color-cookieconsent-bg: light-dark(
oklch(from var(--color-cookieconsent) 100% 0.03 h),
oklch(from var(--color-cookieconsent) calc(l + 0.07) c h)
);
display: flex;
flex-flow: wrap;
justify-content: center;
gap: 0.5rem;
gap: .5rem;
position: sticky;
bottom: 0;
width: 100%;
padding: var(--spacing-xs);
color: var(--color-cookieconsent-text);
background-color: var(--color-body-bg);
border-block-start: 4px solid var(--color-cookieconsent-text);
color: var(--color-warning);
background-color: var(--color-warning-bg);
border-block-start: 4px solid var(--color-warning);
font-size: var(--fs-s);
transform: translateY(100vh);
transition: all 130ms ease-out;
z-index: 99;
.cookieconsent__message {
font-family: var(--ff-alt);
font-size: var(--fs-xs);
}
.cookieconsent__actions {
display: flex;
gap: 0.5rem;
gap: .5rem;
}
&[hidden] {

View file

@ -1,13 +1,13 @@
.disabled {
/* Re-set default cursor for disabled elements. */
cursor: default;
color: var(--color-disabled);
color: var(--color-button-disabled);
&:hover,
&:focus,
&:active {
/* Override any link underlines and color changes. */
color: var(--color-disabled);
color: var(--color-button-disabled);
text-decoration: none;
}
}

View file

@ -10,7 +10,7 @@
}
}
@media (width >= 666px) {
@media (min-width: 666px) {
.flex-group--2 > * {
flex-basis: calc(100% / 2 - var(--flex-gap));
flex-grow: 0;

Some files were not shown because too many files have changed in this diff Show more