Install

Works with Drupal: ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 332.96 KB
MD5: 9925a278395ecc8ed39dcdfcfeb280c9
SHA-1: 99d35fc4025e8b12d0818b6b8b0f7e5b914048f0
SHA-256: 1ae72b4f7de46d759a93625e1570e1a253ea1b7c52dca26b041c8d337e593302
Download zip 818.71 KB
MD5: f814b558d5a06918e8b0ae36e21bfddd
SHA-1: 7e899a62b907b34039f53a7463d4b30d770929c3
SHA-256: 952d6d52a9f9ecf77a48e342e481d4a766f27c9f4abf47c28657f0b26495d2e9

Release notes

Cordwainer Elements 1.0.5 loads its scripts in the page head instead of at the end of the page. Components upgrade sooner after the page loads, and visitors in dark mode no longer see the light theme flash before the dark theme is applied.

Bug fixes

  • cw-elements.js and the color-scheme script now load in <head>. In 1.0.4 they were meant to, but loaded at the end of <body>, because Drupal only reads header on a library, not on the individual files in it.
  • The color-scheme script runs before the page is first painted, so cw-theme-dark is on <html> from the start for visitors whose operating system is in dark mode.

Changes to libraries

  • cordwainer_elements/custom-elements now sets header: true on the library itself.
  • The color-scheme script, js/cem-sdc-generator-color-scheme.js, moves into its own library, cordwainer_elements/custom-elements-color-scheme. It also loads in <head>.
  • cordwainer_elements/custom-elements depends on cordwainer_elements/custom-elements-color-scheme, so code that attaches custom-elements still gets the color-scheme script without any changes.

Upgrading

Rebuild caches after updating. No configuration or database changes are needed.

If your theme or module adds JavaScript that needs to stay in the footer, keep it in a library of its own, without header, that depends on cordwainer_elements/custom-elements. Drupal loads a header library's dependencies in <head> too, so custom-elements must not depend on it.

Issues fixed

  • #11: Regenerate the module so its scripts load in the page head

Related

Created by: matthand
Created on: 31 Oct 2026 at 20:05 UTC
Last updated: 31 Oct 2026 at 20:06 UTC
Bug fixes
Unsupported

Other releases