Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

This module allows you to override the CSS variables of your site theme without having to deploy.

This is useful for sites that only require minor adjustments to the base theme, as it enables customisation without the need for deployment.

CSS variables are exposed by just wrapping your CSS variables into annotations.

Features

  • Override of variables in the main CSS files of your theme.
  • Override of variables of the SDCs.
  • Auto discover of CSS variables through CSS comment annotations.
  • Preview of changes before saving customizations.
  • Support for multiple themes.
  • Easy maintenance: once a variable is removed from code, it won't appear anymore in the configuration page.

Post-installation

After installation, you need to set up your theme to support customisations.

First, declare the source files of the main CSS in the .info.yml file of your theme.

css_variables_customizer:
  stylesheets:
    - cssSourceFolder
    - src/cssSpecificFile.css

In the 'stylesheets' section, it is possible to add folders.

To let the variables be discovered, they need to be wrapped in these annotations:

  1. Beginning: @css-variables-customizer-category category . Replace category with any name, it will be displayed in UI.
  2. End: @css-variables-customizer-category-end . Add this after the last variable you want override.

Example:

  /* @css-variables-customizer-category theme */
  --card-media-aspect: 16/9;
  --card-radius: var(--theme-radius, 0.5rem);
  --card-spacing: var(--theme-spacing, 0.25rem);
  /* @css-variables-customizer-category-end */

Clear caches, then go to /admin/appearance/css-variables-customizer. Your theme will appear in the list, allowing you to select it and override the variables.

It is highly recommended to use the SDC Styleguide module to preview the component overrides.

Similar projects

UI skins allows to declare variables in a YAML file and then override them.

Activity

Total releases
4
First release
Aug 2025
Latest release
6 months ago
Release cadence
16 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-beta3 Pre-release Sep 25, 2025
1.0.0-beta2 Pre-release Sep 11, 2025
1.0.0-beta1 Pre-release Aug 8, 2025
1.x-dev Dev Aug 7, 2025