- Issue created by @mogtofu33
- Merge request !259Draft: Issue #3499985 by mogtofu33: Support for UI Skins theme setting → (Open) created by mogtofu33
- 🇫🇷France Grimreaper France 🇫🇷
Thanks a lot for the feature request and the MR.
I will give a look and test.
- 🇫🇷France pdureau Paris
Can we move...
The declaration in some YAML files?
in order to be authorable by front developers.
For example, naive proposal in ui_suite_bootstrap.ui_skins.themes:
# No target because scopable. # No value because same as plugin ID. dark: label: "Dark" label_context: "color" key: "data-bs-theme" bg_utility: - bg-dark fg_utility: - text-bg-dark # No target because scopable. # No value because same as plugin ID. light: label: "Light" label_context: "color" key: "data-bs-theme" utility_equivalent: - bg-light - text-bg-light
The Bootstrap::getThemeMapping() logic in UI Skins?
We can keep the apply in the ui_suite_bootstrap PHP code for now, so those function will call the new UI Skins API:
- PreprocessPage::preprocess()
- PreprocessMediaMediaLibrary::preprocess()
- FormMediaLibraryAddFormAlter
- ElementPreRenderLayoutBuilder
- 🇫🇷France Grimreaper France 🇫🇷
UI Skins issue created ✨ Theme definition: link to utility classes Active .
I will isolate generic stuff unrelated to theme selection in another MR to merge it right now.
- Merge request !260Issue #3499985 by mogtofu33, grimreaper, pdureau: Transversal improvements. → (Merged) created by Grimreaper
-
grimreaper →
committed e231dd81 on 5.1.x
Issue #3499985 by mogtofu33, grimreaper, pdureau: Transversal...
-
grimreaper →
committed e231dd81 on 5.1.x
- 🇫🇷France Grimreaper France 🇫🇷
Merged what was independent from UI Skins.
First MR rebased, so it is clearer what needs to be made generic.
Postponing until UI Skins issue is done.
- Merge request !261Issue #3499985 by grimreaper, mogtofu33, pdureau: UI Skins: support theme setting → (Open) created by mogtofu33
- 🇫🇷France mogtofu33
Seems like just removing the specific light classes is enough for the dark theme support!
- Status changed to Needs review
28 days ago 9:39pm 7 June 2025 - 🇫🇷France Grimreaper France 🇫🇷
grimreaper → changed the visibility of the branch 3499985-extract to hidden.
- 🇫🇷France Grimreaper France 🇫🇷
Found missing spots.
JS:
- assets/js/text/text.js
- assets/js/misc/tabledrag.jsSome btn-outline-dark, so I think the theme class should be made available in a drupalSettings.
src/Utility/Element.php:
// Find a class based on the value of "value", "title" or "button_type". if (!$class) { $themeClass = Bootstrap::getThemeMapping(); $value = $this->getProperty('value', $this->getProperty('title', '')); /** @var string $button_type */ $button_type = $this->getProperty('button_type', 'outline-' . $themeClass); $class = "{$prefix}-" . Bootstrap::cssClassFromString($value, $button ? $button_type : 'outline-' . $themeClass); }
src/HookHandler/PreprocessMenuLocalAction.php:
$class = Bootstrap::cssClassFromString($link['title'], 'outline-dark');
On PHP side, maybe for both, but at least for PreprocessMenuLocalAction, the problem is that it is the opposite that needs to be gathered. When in dark mode, we need outline-light.
So, more complex than a simple mode/class pair only.