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

Theme.json: Block specific CSS is printed even if a block is not used on the current page #31642

Closed
carolinan opened this issue May 10, 2021 · 6 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement. [Type] Performance Related to performance efforts

Comments

@carolinan
Copy link
Contributor

What problem does this address?

When you set defaults for a block using theme.json, the CSS is printed in .global-styles-inline-css even if the block is not used on the current page.

What is your proposed solution?

Only include the CSS if the block is used on the current page.

@annezazu annezazu added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement. CSS Styling Related to editor and front end styles, CSS-specific issues. [Type] Performance Related to performance efforts labels May 17, 2021
@carolinan
Copy link
Contributor Author

@aristath I wanted to check in if you still want to be assigned to this issue and if there is any progress.

@aristath
Copy link
Member

aristath commented Aug 9, 2021

There is no progress because other things needed to be prioritized, and this issue may be sub-optimal behavior but it doesn't actually "break" anything, so it was not an urgent priority.

I'm unassigning myself because maybe the "assigned" prevents someone else from working on it? 🤷

@oandregal oandregal mentioned this issue Aug 9, 2021
82 tasks
@oandregal
Copy link
Member

I'm interested in picking this up. Going to take Ari's offer and assign this to me.

@scruffian
Copy link
Contributor

I had a go at this here: #39571

@scruffian
Copy link
Contributor

Here's an alternative version: #40513

@scruffian
Copy link
Contributor

This was closed by #41160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement. [Type] Performance Related to performance efforts
Projects
None yet
Development

No branches or pull requests

5 participants