Styles that are wrapped with editor styles wrapper are not cached #18741
Labels
[Feature] Custom Editor Styles
Functionality for adding custom editor styles
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
The mechanism we have to wrap styles with editor styles wrapper is to pass a string with the content of the stylesheet via editor settings and then Gutenberg changes this string before adding it to the dom as a style element.
This solution has a problem, the styles are not cached by the browser, the string with the styles is passed every time the editor loads.
These styles include styles implemented by the theme and can have a considerable size.
I think we should enqueue these styles normally so they are cached by the browser. On settings, we should pass identifiers of the stylesheets that should be rewritten (e.g: the path) on Gutenberg we should dynamically change the stylesheets to wrap them.
The text was updated successfully, but these errors were encountered: