You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the dev call today, we discussed potential benefits of allowing the attachment of libraries, js, css with hook_theme, rather than having to manually add them with backdrop_add_library() within a preprocess function, for example.
Proposed solution
Allowed #attached values to be used with hook_theme implementations, so that CSS and JS can be specified and be automatically added (only when the theme implementation is actually used). This will allow an easy way to specify libraries, JS and CSS and have it optimized to be used only when needed. Alters will also allow other implementations to make adjustments if needed.
The text was updated successfully, but these errors were encountered:
Allowed #attached values to be used with hook_theme...
Hm, #attached is commonly used with forms or elements (renderable arrays), but in info-hooks? 🤔 @laryn do you have an example, where #attached also works with existing info hooks?
Or, do you mind to elaborate, why you can't attach libs within the actual theme implementation?
Description of the need
During the dev call today, we discussed potential benefits of allowing the attachment of libraries, js, css with hook_theme, rather than having to manually add them with
backdrop_add_library()
within a preprocess function, for example.Proposed solution
Allowed
#attached
values to be used withhook_theme
implementations, so that CSS and JS can be specified and be automatically added (only when the theme implementation is actually used). This will allow an easy way to specify libraries, JS and CSS and have it optimized to be used only when needed. Alters will also allow other implementations to make adjustments if needed.The text was updated successfully, but these errors were encountered: