- Issue created by @pdureau
- Status changed to Closed: works as designed
10 months ago 5:22pm 15 April 2024
Some design systems expect specific CSS & JS to be loaded with a theme/mode.
For example, Europa Component Library expects:
We heard some UI Skins users are using https://www.drupal.org/project/configurable_theme_libraries → to achieve that, but it is confusing to have 2 different mechanisms for a single theme.
Add those properties to theme definition:
libraries
with a list of dependencies. Works like in info.yml file. Libraries are not fully declared here. They need to be declared elsewhere. For example in {extension}.libraries.yml
libraries-override
: which works like in info.yml
https://www.drupal.org/node/2497313 →
Example:
light:
label: "Light"
key: data-mode
target: body
libraries:
- foo/bar
- vendor/baz
libraries-override:
- my_theme/global-styling: false
When the theme is activated, the library is loaded. When the theme is disabled, the library is unloaded.
When the theme is disabled, the library is unloaded? Are we sure about that? What if the library was already loaded by anotehr trigger and it still expected?
Let's copy the same behaviour as https://www.drupal.org/project/configurable_theme_libraries →
No breaking changes
Closed: works as designed
1.0
Code