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: Make the default layout work as a preset. #36944

Closed
youknowriad opened this issue Nov 29, 2021 · 2 comments
Closed

Global Styles: Make the default layout work as a preset. #36944

youknowriad opened this issue Nov 29, 2021 · 2 comments
Labels
[Feature] Layout Layout block support, its UI controls, and style output. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@youknowriad
Copy link
Contributor

Presets (colors and font sizes) work this way:

  • generates a classname and some styles (potentially CSS vars)
  • Apply the classname to the element where they are applied.

The default layout works a bit differently

  • Styles are injected inline with a unique identifier attached to each container, this maps the behavior of custom values instead of presets.

Can we update the default layout to use a "preset-like" approach, this is:

  • generate a classname for the default preset and add the styles to the theme.json stylesheet.
  • apply that classname to the places where it's used.

The goal here is to clarify that it's actually a preset but making it work like all presets and also to have purer CSS. (less inline ones)

cc @ntsekouras @oandregal @jorgefilipecosta

@youknowriad youknowriad added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 29, 2021
@cbirdsong
Copy link

I would be curious to know why was the button block's behavior moved from classes to these repetitive injected .wp-container- styles, as I just had to restore the classes it previously generated via block filters.

@andrewserong
Copy link
Contributor

I believe the intent behind this issue has largely been resolved as of #40875, set to land in WordPress 6.1. I'll close out this issue now, and we can open up new issues for subsequent follow up tasks.

@andrewserong andrewserong added the [Feature] Layout Layout block support, its UI controls, and style output. label Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants