Allow themes/modules to declare libraries via their own *.info.yml

Created on 21 July 2023, 12 months ago
Updated 26 July 2023, 11 months ago

Problem/Motivation

Currently, the only way to declare libraries that Style Selector should attach during rendering is via the module config page. Investigate a way to allow modules and themes to create entries in their own *.info.yml/*.libraries.yml that will be picked up and included as appropriate.

This should also allow removal of style_selector_demo.install.

Proposed resolution

Scan extensions for style_selector keys in *.info.yml, e.g:

style_selector
  shared:
    - mytheme/backgrounds
    - mytheme/foo
  admin:
    - mytheme/bar
  theme:
    - mytheme/baz

Implement a helper method that gathers these "declared" libs and merges with any configured libs.

Update anywhere libs are attached to use the new helper method.

Remaining tasks

  • Code.
  • Test.
  • Merge.

User interface changes

Add a way to list libraries provided by other modules/themes on the module config page.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell

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

Comments & Activities

Production build 0.69.0 2024