Install

Works with Drupal: ^10.3 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 78.61 KB
MD5: b58d196e8e6e13a89f7611f0679d5491
SHA-1: b029200618b1d55f94218fcbdd9f180d20560b99
SHA-256: 031937e657118ea6c51cadce675dcff877a33c2664aeef77115056ee6f4c5aef
Download zip 121.66 KB
MD5: 24f4c30c923dad493e136c835818cbd7
SHA-1: 40594ac42735876fa6ab8c071a1d42949204830e
SHA-256: 9ea0ba8cc4b6bcc729de18c340b7ec4e9047ddfac080229fdd9df6c6502076bc

Release notes

This release focuses on the palette editor experience, Canvas integration, and tightening the security around custom CSS. No breaking changes — sites upgrading from 1.0.0-beta1 get the new editor UX on the next cache rebuild.

Highlights

  • Custom CSS modal editor replaces the cramped inline textarea on color cards.
  • Live group rename — color cards' group checkboxes follow the rename as you type, no save needed.
  • Canvas content templates can now bind curated color fields to SDC props.
  • Custom CSS has length and at-rule validation at save time.

What's new

Palette editor

  • Custom CSS modal editor. Each card now shows a "Custom CSS" label, an Add/Edit link, and a read-only preview of the saved CSS. Editing happens in a Drupal core dialog with a comfortably-sized textarea instead of the cramped inline details field that became unusable when six cards rendered across a row with the Navigation sidebar enabled.
  • Live group rename. Typing in a group name field updates every matching color card's checkbox value, name attribute, and label in place — no AJAX round-trip per keystroke. Adding a brand-new group still triggers an AJAX rebuild (needed for theme-correct checkbox markup).
  • Card layout polish. Remove buttons now align across a row regardless of how much CSS each card displays. Cards stretch to fill their grid cell so the row reads as one unit.

Canvas integration

  • Curated color fields now appear as candidate bindings in Drupal Canvas content templates. The field's value property now declares StringSemantics: prose when Canvas is installed — Canvas's EntityFieldPropSourceMatcher requires this for bare-string SDC props (including those carrying our x-curated-color-palette vendor extension, which Canvas's interpreter ignores during matching). Side effect: the field is also offered for unrelated bare-string props like Title or Caption — a tighter match would require an upstream Canvas hook that doesn't yet exist.
  • core/drupal.dialog added as a palette_form library dependency for the new modal editor.

Security and validation

  • Custom CSS is now capped at 1024 characters (client-side via maxlength, server side via Drupal core's textarea element).
  • Custom CSS values containing at-rules (@import, @font-face, @media, etc.) are rejected at save time. Defense in depth — the shipped renderer outputs CSS into a style="..." attribute where at-rules are ignored, but blocking them at save protects any consumer that wraps the value in a style block.

Bug fixes

  • The computed css property returns an empty string when neither hex nor custom CSS is set, including for colors added at runtime via PaletteColorsEvent::addColor(). Previously the optional hex/style fields defaulted to NULL for event-added colors and were treated inconsistently by some consumers.

Developer experience

  • DDEV-based dev environment lands in the repo. ddev start brings up a Drupal site with the module symlinked in, plus single-command lint/test gates: ddev phpstan, ddev phpcs, ddev phpcbf,
    ddev phpunit, ddev eslint, ddev stylelint, ddev nightwatch.
  • PHPStan bumped to level 6 with a small documented baseline (phpstan-baseline.neon) covering acknowledged-irreducible items.
  • Lint compliance across phpcs, eslint, and stylelint. Coding-standards fixes applied across PHP, JS, and CSS.
  • Test coverage expanded in palette admin, palette editor JS, computed property, palette colors event, and Canvas integration paths. New kernel test pins the StringSemantics constraint behavior with and without Canvas installed.

Upgrade notes

No breaking changes. Saved palette data, the field type schema, computed properties, the administer curated color palettes permission, and the PaletteColorsEvent API are unchanged.

Existing custom CSS values that exceed 1024 characters or contain at-rules are not re-validated until edited — they stay in storage until the palette is saved again, at which point the new rules apply.

Created by: ctrladel
Created on: 18 May 2026 at 19:12 UTC
Last updated: 18 May 2026 at 19:12 UTC
Bug fixes
New features
Unsupported

Other releases