Skip to content

what is the benefit of using per-block JS/CSS? #24

Answered by fabiankaegy
turtlepod asked this question in Q&A
Discussion options

You must be logged in to vote

The main benefit is that you automatically get free frontend code splitting. The assets of your block will only get loaded on the page if the block is actually used on the page. Which especially for CSS was very hard to do previously in the WordPress context.

https://gutenberg.10up.com/reference/Themes/styles#block-specific-styles

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by fabiankaegy
Comment options

turtlepod
Mar 30, 2022
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants