Install
Works with Drupal: ^11.3 || ^12Using 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,detailsanddialog. - 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"ordata-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 respectprefers-reduced-motion, and form fields only show as invalid once the visitor has edited them. - Plain form controls match
cw-input,cw-textarea,cw-selectandcw-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-colorand--cordwainer-theme-text-color-muted--cordwainer-theme-background-color--cordwainer-theme-link-color,--cordwainer-theme-link-color-hoverand--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-familyon them. tests/fixtures/kitchen-sink.htmlcontains 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