bud
bud copied to clipboard
[request] Equivalent of TW's @apply() for bud.wpjson.setStyles()
Agreement
- [X] This is not a duplicate of an existing issue
- [X] I have read the guidelines for Contributing to Roots Projects
- [X] This is not a personal support request that should be posted on the Roots Discourse community
The feature
My idea is a helper method to compile values into their css styles for the wpjson styles. I'm not sure if this is possible, but it would make wordpress styling a lot easier.
Here's an example of what this could look like:
bud.wpjson
.setStyles({
blocks: {
'core/heading': {
spacing: {
margin: {
bottom: applyTwStyle('mb-4'),
},
},
typography: {
fontFamily: applyTwStyle('font-sans'),
lineHeight: applyTwStyle('leading-normal'),
fontWeight: applyTwStyle('font-semibold'),
},
},
},
})
Use case
No response
Notes
No response