Skip to content
Sign inJoin waitlist

Design — Denzel HTML

Denzel’s HTML pages are styled with Tailwind CSS classes and a few colour, font and breakpoint tokens; a new colour or font needs a CSS rebuild.

The pages are styled with Tailwind CSS classes written in the HTML (class="font-sans text-xs uppercase text-grey"). assets/css/style.css contains exactly the classes the pages use, generated from src/css/style.css.

That means two kinds of change:

Change Rebuild the stylesheet?
Move, copy or delete elements; use classes that already appear somewhere in the site No
Change a colour, a font, a breakpoint; use a class that appears nowhere yet (say mt-7) Yes

Once, install the tools (needs Node.js 20 or newer):

Terminal window
npm install

Then, after a change:

Terminal window
npm run build:css # one build
npm run watch:css # rebuilds on every save while you work

Both write assets/css/style.css. The build scans the .html files in the root folder and one folder down (blog/, category/, author/), and assets/js/main.js, so a class you add there is picked up. Upload the new style.css with your pages.

In src/css/style.css:

@theme {
--color-ink: #1c2522; /* headings, titles, links, the search button's hover fill */
--color-body: #707a88; /* excerpts, descriptions, post text */
--color-grey: #999999; /* meta (author, date), "View All", the current menu link */
--color-accent: #e38836; /* category labels, links on hover */
--color-navy: #203656; /* the breadcrumb links on category pages, the author page's socials, typed newsletter text */
--color-pink: #fe4f70; /* the category breadcrumb links on hover */
--color-white: #ffffff;
--color-black: #000000; /* the section dividers */
--color-rule: rgb(0 0 0 / 0.2); /* the thin dividers inside the sidebar boxes */
--color-frame: #999999; /* the hairline around the sidebar boxes and the pill buttons */
--color-veil: rgb(0 0 0 / 0.2); /* the dark veil over the slider's photos */
--color-scrim: rgb(0 0 0 / 0.6); /* behind the search dialog */
--color-search: #333333; /* the search dialog's text */
--color-search-line: #eeeeee; /* the line under the search field */
--color-search-hover: #f3f3f3; /* the highlighted search result */
--color-field: #ebebeb; /* the hairline of the newsletter field */
--color-error: #e5484d;
}

Each name becomes a class (text-ink, bg-accent, shadow-frame). Change the values, rebuild, and the pages follow. The palette is Ink and a cool grey on White, with the orange accent for categories and hovers: keep text on its background at 4.5 : 1 or more, so it stays readable (the light Grey meta text is below that on white; darken it if your readers need it).

Colours that sit outside the tokens:

Colour Where
Ink #1c2522 in the logo and the icon (white in dark browser themes) assets/images/logo.svg, icon.svg
The swatches of the style guide repeat the values as text style-guide.html

The logo is a picture, assets/images/logo.svg (118 × 24: the round mark and the word DENZEL in Ink). It is shown in the header, in the sidebar’s “Denzel” box and in the footer, as <img src="…/logo.svg" alt width="118" height="24"> inside a link whose aria-label="Denzel" carries the name for screen readers. To use your logo, replace the file (an SVG or a PNG about 24 px tall); if its proportions differ, change the width and the width class (w-[118px]) of the image and of its link in the header, and the aria-label.

icon.svg (the round mark, in Ink, white in dark browser themes) is the icon in the browser tab; apple-icon.png (180 × 180) is the icon on a phone’s home screen. Replace the files, keeping the names.

The interface icons are inline SVG from Phosphor: the search icon and the Facebook, Twitter, Instagram and Pinterest icons, drawn on a 256 × 256 grid in the current text colour. To use another icon, open it on phosphoricons.com, copy its <path d="…"> and paste it in place of the old one. The menu button’s lines and the three dots between an author and a date are <span>s in HTML.

Two fonts ship in assets/fonts/ and are declared at the top of src/css/style.css:

  • Noto Serif JP, the serif of the titles, the cards, the menu and the article’s headings: four files, the Latin letters of the weights 500, 600, 700 and 900 (noto-serif-jp-variable-1.woff2 to -4.woff2).
  • Poppins, the sans-serif of the text, the meta, the section titles (“Editor’s Pick”) and the buttons: three files, weights 400, 600 and 700.
@font-face{font-family:"Poppins"; src:url("../fonts/poppins-variable-1.woff2") format("woff2"); font-display:swap; unicode-range:…; font-weight:400; font-style:normal; }
:root{--font-noto-serif:"Noto Serif JP","Noto Serif JP Fallback",serif; }
:root{--font-poppins:Poppins,"Poppins Fallback",sans-serif; }

The pages use them through two classes: font-serif (Noto Serif JP) and font-sans (Poppins, also on the <body>).

To use another font:

  1. Put its .woff2 files in assets/fonts/.
  2. Replace the @font-face rules of the font you change (four for Noto Serif JP, three for Poppins, at the top of the file) with one rule per file and weight, and change the first name in --font-noto-serif or --font-poppins.
  3. Rebuild the stylesheet.

The Noto Serif JP Fallback and Poppins Fallback rules size Times New Roman and Arial like the two fonts while they load (so the page doesn’t jump when the fonts arrive); with another font, you can delete them and their names in the two variables. Fonts from Google Fonts can be downloaded as files with https://gwfh.mranftl.com, so they are served from your own domain, which is faster and needs no consent banner.

Text sizes are the same on every screen. The style guide lists every text style:

Style Size Font Used for
title 28, bold Noto Serif JP The page titles, a post’s title
h3 22, bold Noto Serif JP The headings in a post’s text
h4 18, semibold Noto Serif JP The smaller headings in a post’s text
cardXl 24, semibold Noto Serif JP The large card of Editor’s Pick
cardLg, cardMd, cardSm 18, 16, 14, semibold Noto Serif JP The other cards’ titles
nav 14, medium Noto Serif JP The menu
sectionTitle 18, bold Poppins “Editor’s Pick”, “Recent”, “Newsletter”
paragraph, body 16 Poppins Excerpts, descriptions, a post’s text
small 14 Poppins The breadcrumbs, the newsletter, meta in the article
meta 12, upper case Poppins Authors, dates, category labels
tiny 12 Poppins “View All”

Titles have a line height of 1.4; Poppins text 1.2, or 1.4 for running text.

Spacing uses Tailwind’s scale (4 px per step, so gap-5 is 20 px) or exact values in brackets (gap-[30px]). Content is at most 1220 px wide (max-w-[1220px]), with 20, 30 and 40 px at the sides. Photos have square corners; avatars, category photos and the pill buttons are round; the newsletter field and button have 8 px corners. Sections are divided by a black line, and the sidebar’s boxes have a grey hairline. There are no drop shadows.

Width Prefix
Phone below 810 px (none)
Tablet 810–1199 px md:
Desktop 1200 px and up lg:

max-md: and max-lg: apply below those widths.

style-guide.html shows the colours and text styles, the “View More” pill, the social icons, the author-and-date line in two sizes, the breadcrumb, every kind of post card (large, medium, with excerpt, as a row, small and round) and the article’s text, each with its name. To reuse one, copy its markup from there or from the page that shows it.

Elements with data-… attributes are wired to the site script, so keep those attributes when you copy them: data-header, data-menu-toggle, data-menu-icon, data-menu, data-close-menu, data-open, data-closed, data-open-search, data-search, data-search-items, data-search-box, data-search-input, data-search-clear, data-search-list, data-search-scrim, data-post-slider, data-slider-track, data-copy, data-newsletter, data-newsletter-button, data-newsletter-status, data-current-year.

Denzel’s motion is small: hovers, the menu, the search dialog and the slider. There are no scroll effects and no load animations. A few settings are written in the HTML:

Effect Where
Links and titles turn orange or underlined on hover hover:text-accent, hover:underline
Cards: the photo, slightly enlarged, settles to its size when you point at the card scale-110 and group-hover/photo:scale-100 with duration-[714ms] ease-spring (--ease-spring in src/css/style.css)
The slider: the veil over a photo clears on hover group-hover/photo:bg-transparent
The slider moves one step every five seconds data-post-slider (the script)
The phone menu opens with its height; the search dialog grows in on desktops and slides down on phones data-menu-toggle, data-open-search (the script)

The springs of the script are at the top of the site’s own code in assets/js/main.js (search for tokens/motion.ts), and the slider’s pace (INTERVAL = 5e3, in milliseconds) a little further down.

With “reduce motion” switched on in the visitor’s system, the slider stands still, the photos of the cards change size without gliding, and the phone menu’s height and the search dialog’s grow or slide jump instead of gliding. Fades and colour changes stay.