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

Spacing presets: add utility classes to block to indicate current spacing preset settings #45431

Open
glendaviesnz opened this issue Oct 31, 2022 · 2 comments
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@glendaviesnz
Copy link
Contributor

What problem does this address?

Currently, the spacing presets are added to blocks via inline styles only. It would be useful to have utility classnames as well/instead in the same way that font-sizes do in order to allow further styling by themes based on presets applied.

What is your proposed solution?

Use the existing style engine infrastructure to apply utility classnames to the block wrappers where spacing presets have been applied.

Because of the large number of variations for spacing presets, eg. has-bottom-padding-10 times 7+ preset slugs, x four sides = a minimum of 28 new utility classes with associated CSS vars being output, so it would be good if only the classes needed for the current page were output.

@glendaviesnz glendaviesnz added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Oct 31, 2022
@glendaviesnz glendaviesnz self-assigned this Oct 31, 2022
@kathrynwp kathrynwp added the [Type] Enhancement A suggestion for improvement. label Nov 1, 2022
@cbirdsong
Copy link

cbirdsong commented Feb 10, 2023

Has there been any work on this? The lack of these makes using add_theme_support( 'disable-layout-styles' ); a real tradeoff.

@glendaviesnz
Copy link
Contributor Author

@cbirdsong as far as I am aware there hasn't. As soon as some of the 6.2 release priority work is covered off I will see if we can take a look at what will be involved in implementing this.

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 [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants