-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style variations: Allow child themes to exclude specific parent theme style variations #51277
Comments
I echo this suggestion, given the extensive exploration I am going through as I prepare to ship a theme/system shortly. I would love to leverage this functionality, but I need to make decisions based on what is currently available. |
One thing that might be helpful here is having an API for registering variations. Currently, there's just a class method, WP_Theme_JSON_Resolver::get_style_variations(), for getting all of the variations under the At the very least, the function could use a filter hook for overwriting the |
It would also be nice to see this with patterns. |
@graylaurenm - You can already remove patterns registered by the parent theme. Check out the documentation in the Theme Handbook: https://developer.wordpress.org/themes/features/block-patterns/#unregistering-block-patterns |
@justintadlock thank you, I must not have Googled this one. 🤦♀️ |
I'd like to add my support to this suggestion, I was kind of surprised that this wasn't already a filter. It's important to anyone who wishes to lock down the a theme in terms of style variations (eg brand colours and fonts), but still allow people the ability to edit templates through the editor otherwise. A child theme currently seems to be my way to deal with some of the issues of controlling block themes, and currently I can remove style variations from the parent by deleting the json files from the theme/styles folder but I suspect they would come back on the next theme update. My only other option currently would be to make my own block theme from scratch, which would then miss out on the team updates that 2023/4 are getting. So yes, would be very nice to at least have something I could put in functions.php to limit this. |
+1. Agreed. Using TT4, I can easily add a style variation by including the appropriate json file in my child theme. I can also override a parent style variation by naming the json file the same as one of the defaults (e.g., naming the file mint.json but using a different title and different palette within the json file). But I can't remove any of the parent's style variations. |
I'm not sure if this is the appropriate forum for a style variation question, so please forgive me if there's a better place to do that. But I just realized that each style variation in TT4 is also loading its own font sets. Are all 8 font sets loaded into memory, or only those related to the active style variation? |
+1 |
Would love to see some movement on this. |
+1 |
I'd also like to see this feature, not just for style variations but pattern variations, too. |
+1 |
I renamed the folder "styles" to "styles_OFF" in TT4 and that did at least work as a workaround until the next update. |
+1 Add it to the next update please ... |
Looking forward to this addition! It will greatly enhance flexibility for child themes. |
What problem does this address?
If you create a child of a parent theme like TT3, the child theme will include all of the parent's style variations. For theme developers, this is not always preferred.
This issue was mentioned in #45965 (comment) and is related to #47265. Providing a more robust way for child themes to handle the style variations of a parent theme would greatly improve the experience of building block themes that support these features.
What is your proposed solution?
Provide a method for child themes to exclude a parent's style variations.
The text was updated successfully, but these errors were encountered: