Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Blocks style in the editor does not match the frontend's blocks style #202

Closed
amjadr360 opened this issue Sep 23, 2022 · 5 comments
Closed

Comments

@amjadr360
Copy link

amjadr360 commented Sep 23, 2022

For some blocks blocks/***/theme.min.css is used to keep consistency across the UI(editor/frontend) and add_theme_support( 'wp-block-styles' ); is used to add theme.min.css's CSS as inline-CSS at fronted. As Twenty Twenty Three theme no longer uses functions.php.

Before I open any PR, I want to discuss solutions to keep consistency across the UI.

  • Adding back functions.php for this only not seems a good idea.
  • Adding custom CSS is not a good idea.
  • Moving blocks/***/theme.min.css CSS to blocks/***/style.scss. Might be. But backward compatibility.
  • Improve those blocks style that uses 'theme.min.css`. Yes, this soulation LGTM.

Here are blocks that have style consistency issues.

image
image

@carolinan
Copy link
Collaborator

I would expect those styles to not be loaded in the editor unless the theme supports wp-block-styles. I think this is a Gutenberg bug or even possibly a regression.

@carolinan
Copy link
Collaborator

Also, I see that these images use the theme test data. That XML file is not up to date with the current block markup.

@aristath
Copy link
Member

aristath commented Sep 26, 2022

Looking at the code, I can see that if $editor_styles is empty, we load wp-block-library-theme as a dependency for wp-edit-blocks style. Perhaps we should remove the dependency from there? (in client-assets.php)

@mikachan
Copy link
Member

mikachan commented Oct 4, 2022

WordPress/gutenberg#44640 may fix this issue 🎉

@mikachan
Copy link
Member

I believe these issues have been fixed by WordPress/gutenberg#44640.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants