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

PostCSS usage is broken in editor if Yoast is used. #120

Open
tcmulder opened this issue Sep 9, 2024 · 1 comment
Open

PostCSS usage is broken in editor if Yoast is used. #120

tcmulder opened this issue Sep 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tcmulder
Copy link
Owner

tcmulder commented Sep 9, 2024

When Yoast is active, the editor canvas iframe falls back to the old div.editor-styles-wrapper version that attempts to scope all CSS. When using PostCSS, currently nested CSS gets output as nested CSS, since it has support in all modern major browsers; but, in the old div.editor-styles-wrapper version of the editor, this causes parent CSS to have .editor-styles-wrapper nested between them and their children.

Issue opened here for that issue.

Solutions:

  1. I'm going to try just using scss for now, as it seems to perform all the nesting translations back to an older version of CSS.
  2. Maybe I could get PostCSS to disable nesting. Wasn't finding very clear documentation on how to opt out of common CSS functionality.
  3. I can enqueue the CSS in the enqueue_block_editor_assets hook, but things break outside the editor: nothing is scoped in the old div.editor-styles-wrapper version of the editor.
@tcmulder
Copy link
Owner Author

Here's the ticket in Yoast: Yoast/wordpress-seo#20535

@tcmulder tcmulder added the bug Something isn't working label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant