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

Global Styles: Elements support tracking issue #40966

Closed
9 of 10 tasks
Tracked by #41232
scruffian opened this issue May 10, 2022 · 2 comments
Closed
9 of 10 tasks
Tracked by #41232

Global Styles: Elements support tracking issue #40966

scruffian opened this issue May 10, 2022 · 2 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Dev Note Requires a developer note for a major WordPress release cycle [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@scruffian
Copy link
Contributor

scruffian commented May 10, 2022

What are elements?

Elements are a representation of HTML primitives that be used inside blocks. Some examples include link, heading and button.

Why use elements?

Many different blocks can use the same elements. By using elements inside blocks we make it possible for all elements to share the same styles regardless of what block they are in. This is powerful for elements like buttons and form fields which are used in many different blocks. If block developers use the elements in their blocks then themers and users will be able to ensure that all blocks have matching styles without using CSS.

What's the difference between an element and a block?

Elements can be used exist in many different blocks - they can be the things that blocks are built from, although not exclusively. For example the Button block uses a button element, as does the Search block and File block.

Which styles win, the block styles or the element styles?

Elements are lower down in priority order, so block styles will take precedence. This means you can have consistent styles across all buttons on your site with the exception of one particular block.

Will blocks have to use elements?

No. Blocks are free to output whatever HTML they like, but we’d encourage block builders to use elements where they exist so that themes can control their appearance.

This is a tracking issue for adding support for more elements to Global Styles. Currently only headings and links are supported and there's not a full UI for them:

@scruffian scruffian added [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels May 10, 2022
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Sep 14, 2022
@bph
Copy link
Contributor

bph commented Sep 14, 2022

@scruffian already drafted the Dev Note

@scruffian
Copy link
Contributor Author

I think we can close this now. There's still the question of form elements but we have an issue for that here: #34198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Dev Note Requires a developer note for a major WordPress release cycle [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

2 participants