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

Elements: Add a more usable API #41663

Closed
scruffian opened this issue Jun 10, 2022 · 1 comment
Closed

Elements: Add a more usable API #41663

scruffian opened this issue Jun 10, 2022 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@scruffian
Copy link
Contributor

What problem does this address?

We introduced a class name for button elements in #40260, but to use this developers need to look up what the correct class name for each element is which is far from ideal.

What is your proposed solution?

There was some discussion in #40260 about the best way forward but we didn't reach any agreement, here are some options:

  1. Each element could have a component
  2. We could have a hook that adds the class name to the block props
  3. We could have a simple function that returns the correct class name when passed an element name.

For what it's worth, my preference is option 3.

@scruffian scruffian added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jun 10, 2022
@scruffian
Copy link
Contributor Author

Fixed by #41753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

No branches or pull requests

1 participant