Block editor: log error if styles are loaded through the compatibility layer#31870
Block editor: log error if styles are loaded through the compatibility layer#31870youknowriad merged 4 commits intotrunkfrom
Conversation
f393436 to
705d486
Compare
|
Size Change: -750 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
705d486 to
cf16dee
Compare
989bd4d to
9ed2e9f
Compare
| if ( isMatch && ! doc.getElementById( ownerNode.id ) ) { | ||
| // eslint-disable-next-line no-console | ||
| console.error( | ||
| `Stylesheet ${ ownerNode.id } should be added as an editor style.`, |
There was a problem hiding this comment.
Block styles can also end up here as well right? Should we include that in the message? If it's a theme style sheet, make it an editor style, if it's a block style, assign it to the block style property?
There was a problem hiding this comment.
No, theme styles are handled through the settings, so they're always correctly loaded.
There was a problem hiding this comment.
I was talking more about the styles that get these console errors printed. The message says that it should be added to "editor style" but "editor style" is only for "theme" editor styles right? Blocks and plugins shouldn't be using that right?
There was a problem hiding this comment.
Oh, right. For blocks it should be package.json. I'll link to the relevant documentation.
There was a problem hiding this comment.
I added more information now.
Description
We must communicate that this is not the right way to load styles into the iframe. The compatibility layer could be removed in the future. Styles must be loaded properly as editor styles.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.jsfiles for terms that need renaming or removal).