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

Include styles in <head> instead of footer #181

Open
mikemanger opened this issue Sep 3, 2024 · 2 comments
Open

Include styles in <head> instead of footer #181

mikemanger opened this issue Sep 3, 2024 · 2 comments

Comments

@mikemanger
Copy link

Currently the plugin enqueues block and global block styles in the footer, this is causing some large Cumulative Layout Shift (CLS) issues across our sites. It also makes it difficult/confusing to override styles for individual blocks via the className property.

The fix should just involve moving the enqueue styles code out of the render callback and some logic to add the relevant args to the register_block_type() function call.

@mikemanger
Copy link
Author

mikemanger commented Sep 3, 2024

I appreciate WP Engine have stated they're not accepting enhancements/features to this plugin and that this can be achieved via hooks, however I thought I'd check if a PR would be considered before we commit developer time to this in October.🚀

@mikemanger
Copy link
Author

We have published a shim WordPress plugin to https://packagist.org/packages/lighthouseuk/wp-gcb-block-asset-tweaks.

If there is any appetite I can submit a PR to merge in the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant