Install

Works with Drupal: ^11.3 || ^12

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 25.96 KB
MD5: 04b89c118753524ef8d52276b2307cc8
SHA-1: 8c0daf1601ab3898c581cf7876d4f7b7ff7648d8
SHA-256: 092aa5541991b89f6f10460cbd0acbe3a86c40e5674c49d3b013fe4861a22e54
Download zip 33.57 KB
MD5: 17c5170b8482ed0bc5ceb2882197100a
SHA-1: 7744421ced5c3db77dea445ca17011601eada325
SHA-256: 38a962454b5dbf71ec1f71875de020f00249dbc099994f1098b554ac4ffcb8c3

Release notes

Cordwainer Theme 1.0.0-alpha2 styles plain HTML content with Cordwainer Elements design tokens and adds dark mode support. Text, links, lists, tables and forms in the main content now match the components around them, in both the light and the dark theme.

New features

  • A new stylesheet, css/elements.css, styles native HTML elements inside <main>, such as a node body or rich text in a Canvas page. It covers text, headings, links, lists, code, quotes, tables, form controls, media, details and dialog.
  • Pages follow the visitor's operating system dark mode setting. Everything is styled with --cw-* tokens, so the dark theme applies without any dark-mode rules of its own.
  • To use one theme for every visitor, set data-color-scheme="light" or data-color-scheme="dark" on <html>.
  • Text and link colors meet WCAG 2.2 AA contrast in both themes. Links keep their underline in every state, focus rings use --cw-focus-ring, transitions respect prefers-reduced-motion, and form fields only show as invalid once the visitor has edited them.
  • Plain form controls match cw-input, cw-textarea, cw-select and cw-button.
  • Links and lists slotted into the header, footer and navigation keep the components' own styling.

For subtheme developers

  • Every rule has zero specificity, so a subtheme's own rule always wins without !important.
  • New custom properties restyle the content without writing selectors. They're public API, documented in the README, and won't be renamed or removed before the next major version:
    • --cordwainer-theme-text-color and --cordwainer-theme-text-color-muted
    • --cordwainer-theme-background-color
    • --cordwainer-theme-link-color, --cordwainer-theme-link-color-hover and --cordwainer-theme-link-color-visited
    • --cordwainer-theme-border-color
    • --cordwainer-theme-heading-font-weight
    • --cordwainer-theme-block-spacing
  • Headings inherit their font, so a subtheme can set font-family on them.
  • tests/fixtures/kitchen-sink.html contains every styled element and state, for checking changes in both themes.

Requirements

  • Cordwainer Elements 1.0.4 or a later 1.x release, the first with the dark theme. Before, any 1.x release from 1.0.1 was enough.

Upgrading

Update Cordwainer Elements to 1.0.4 along with this release, for example with composer update drupal/cordwainer_theme drupal/cordwainer_elements, then rebuild caches. No configuration or database changes are needed.

Content in the main region is restyled after updating. If your subtheme uses literal colors rather than --cw-* tokens, check it in dark mode.

Issues fixed

  • #3628090: Style native HTML elements with Cordwainer Elements design tokens
Created by: matthand
Created on: 31 Oct 2026 at 19:27 UTC
Last updated: 31 Oct 2026 at 19:27 UTC
New features

Other releases