-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Container queries in editor styles not parsed / generate error in block-editor.min.js #46277
Comments
It looks like the issue is this code: It parses the CSS, and it must not understand the newer syntax of container queries. I haven't seen this code before, so I don't know much about it, but it was added in #9008. It seems like it's based on another library. It might be possible for Gutenberg to use this upstream library directly (there were some comments about doing that in the original PR about this). However, that library does seem to have similar issues over parsing newer syntax - reworkcss/css#165. |
Seconding that this is a problem we've run into. In the interim we can load our editor stylesheet via |
It looks like modifying it to add an It looks like the other library hasn't seen updates since 2021 and has maintenance issues, possibly semi-abandoned? |
I've made a best effort attempt to add container queries to the relevant files in #49915, I don't have much more bandwidth to look at this today though |
Is there any workaround for this we can do for now? Built blocks using container queries since blocks are their perfect use case only to find out that it breaks the editor styling. |
Marking this as resolved by #49521 |
Description
I tried to use container queries (
@container
) within the custom Gutenberg editor CSS.A simple css file with the following content only:
added with
add_editor_style('PATH_TO_CSS');
, leads to the following error:Step-by-step reproduction instructions
functions.php
viaadd_editor_style('PATH_TO_CSS');
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: