Open steffenr opened 6 years ago
I am facing a similar issue.
theme_base
– Base theme with UI pattern named hero
.theme_child
– Child theme based on theme_base
.
hero
as defined in theme_base
.hero
– so, I copy the hero
directory from theme_base
and put it in the theme_child
and add the field to hero.patterns.yml
hero
still doesn't detect the extra field defined in theme_child/patterns/hero/hero.patterns.yml
It will be great to support such overrides.
I investigated the issue and ultimately it boiled down to something similar to PR 159. My solution ensures that the overrides get priority as follows (the one at the top gets least priority):
With this, one should be able to have some out-of-the-box patterns in a module or a base theme with the provision of overriding them in the project-specific theme.
It'll be great if you could review it soon (and the other PR I created for adding a menu link item for the ui pattern library page).
Any luck with this one? I've used this on 3-4 prod projects. It'll be good if you could review and merge it.
We want to build "kind-of" base components/ ui_patterns in a module. Those patterns can be used "as is" or can be overridden on theme-layer. Best example for such a usecase would be a slider - default would be a slick slider. The slider is fine for most cases, but in some special cases, we want to use a custom library for the slider in our theme. Instead of using a hook alter function or creating a new pattern, the theme-dev would just duplicate the pattern in the theme and change the libraries definition.
Right now the discovery is scanning for theme related files first and adds module defined patterns second. This could be easily changed. This should not break anything by the module.
I already created a small PR fixing this issue. #159 #