Theme.json To Set MinHeight of Core/Cover #43435
RCNeil
started this conversation in
Developer Experience
Replies: 2 comments
-
Yes. Currently in theme.json it is not possible to set default values for attributes defined in blocks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
would love to be able to set attributes of blocks instead of overwriting this with css +1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am attempting to set some default attributes for my
core/cover
block in mytheme.json
file. I would like the min-height attribute to be 300px by default. Here is my theme/json code:{ "version": 2, "settings": { "layout": { "contentSize": "1080px", "wideSize": "1440px" }, "spacing": { "blockGap" : true, "margin": true, "padding": true, "units": [ "rem", "px", "%"] }, "blocks": { "core/cover": { "minHeight" : 300, "minHeightUnit": "px" } } } }
Is this attribute not able to be set? It doesn't appear to be taking the value, though I am referring to the theme.json defaults in the block.json for that block https://github.com/WordPress/WordPress/blob/master/wp-includes/blocks/cover/block.json
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions