bud icon indicating copy to clipboard operation
bud copied to clipboard

[request] Equivalent of TW's @apply() for bud.wpjson.setStyles()

Open broskees opened this issue 1 year ago • 0 comments

Agreement

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

broskees avatar Dec 22 '23 22:12 broskees