Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Twenty Twenty Blocks: Remove entry-styles-wrapper classes from editor-style-block.css - #49

Merged
jffng merged 2 commits into
masterfrom
twenty-twenty-blocks/remove-entry-styles-wrapper-specificity
Jul 23, 2020
Merged

Twenty Twenty Blocks: Remove entry-styles-wrapper classes from editor-style-block.css#49
jffng merged 2 commits into
masterfrom
twenty-twenty-blocks/remove-entry-styles-wrapper-specificity

Conversation

@kjellr

@kjellr kjellr commented Jul 21, 2020

Copy link
Copy Markdown
Collaborator

Followup to #44. @jffng pointed out that editor-style-block.css uses the .editor-styles-wrapper class throughout it. This is a remnant from the original Twenty Twenty Theme, where the stylesheet was pulled in via the enqueue_block_editor_assets hook instead of the usual add_editor_style. Since we use add_editor_style in the blocks-based version, those editor-styles-wrapper classes should be prepended automatically, and are not necessary to use in the stylesheet anymore.

To test: Compare editor styles on master to this branch, and make sure they look and work the same.

@kjellr kjellr added the enhancement New feature or request label Jul 21, 2020
@kjellr
kjellr requested a review from jffng July 21, 2020 18:53
@kjellr kjellr self-assigned this Jul 21, 2020

@jffng jffng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like because we're still enqueueing these same styles for the site editor, some styles are leaking when not scoped to .editor-styles-wrapper:

Screen Shot 2020-07-22 at 10 32 25 AM

@kjellr

kjellr commented Jul 22, 2020

Copy link
Copy Markdown
Collaborator Author

Oh right! I'm not sure we need to enqueue those there anymore. We can either remove that, or we can specify that we only load this in the site editor screen.

@kjellr

kjellr commented Jul 23, 2020

Copy link
Copy Markdown
Collaborator Author

@jffng I removed that enqueue entirely, and the editor styles are still working for me in the full-site editor. Would you mind giving this another look?

@jffng
jffng self-requested a review July 23, 2020 13:24
@jffng
jffng merged commit 36a0c38 into master Jul 23, 2020
@jffng
jffng deleted the twenty-twenty-blocks/remove-entry-styles-wrapper-specificity branch July 23, 2020 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants