5th UI Suite module: UI Skins

Created on 23 September 2022, about 2 years ago
Updated 24 June 2023, over 1 year ago

Problem/Motivation

A few design system mechanisms must be declared in the theme settings (/admin/appearance/settings):

  • "Theming": some design systems have CSS switching like light/dark theme, or different tones. Most of the time, the theme can be defined with a class in the HTML or BODY element (ex: Tailwind)
  • CSS variables: some design systems expose CSS variables (CSS custom properties) which can be changed at run time (ex: Bootstrap5, Material...)
  • Page layout management: because /admin/structure/block is not powerful enough (no possible to use configurable layout plugins here), we need to decide here if page wrapper is inside or outside the container, and some settings of patterns called from page.html.twig

Today, those settings must defined in a hook_form_system_theme_settings_alter() and stored in {theme}.settings.yml config file in the config store.

Proposed resolution

hook_form_system_theme_settings_alter() is not OK because not declarative and not front-end friendly, we may need:

  • define a new YAML in the theme root: {theme}.theme.yml
  • define a generic hook_form_system_theme_settings_alter() in the module, to automatically expose the content of {theme}.theme.yml
  • inject theming as attribute class in page preprocess, CSS variables as style attachment in html preprocess, and page layout settings as variables in page preprocess

Remaining tasks

Do we all agree with this big change (adding and promoting a new module must be wisely decided)?

🌱 Plan
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024