Skip to content

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

@broskees

Description

@broskees

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions