Skip to content
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

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

Open
3 tasks done
broskees opened this issue Dec 22, 2023 · 0 comments
Open
3 tasks done

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

broskees opened this issue Dec 22, 2023 · 0 comments

Comments

@broskees
Copy link

broskees commented Dec 22, 2023

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 broskees changed the title [request] Equivalent of @apply() for bud.wpjson.setStyles() [request] Equivalent of TW's @apply() for bud.wpjson.setStyles() Dec 22, 2023
@kellymears kellymears self-assigned this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants