-
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
Reset all WP Admin styles in the wrapper of the editor styles. #29590
Conversation
if ( 0 === strpos( $style['css'], "body { font-family:" ) ) { | ||
unset( $settings['styles'][ $j ] ); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core automatically loads a style setting a default font family, this hack removes that editor style (reset to browser defaults)
Size Change: +1.37 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
yes, some of the margins (the ones relying on figure) are fixed here #29517 And yeah, we won't be able to fix all in one go, we need to find a way to iterate and remove these differences bit by bit. |
This is so cool. |
I think we need to do this but I am worried about how it will effect existing themes. |
Something I consider is whether we could load the "default font style" but only for themes that don't provide any custom editor styles. That was the whole original idea of that "editor-styles.scss" file but somehow/somewhere it changed it got loaded for all themes (and I didn't know about it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I see that @carolinan has 5 merged commits and a lot of other types of contributions that is more than enough fro Gutenberg team member status 😄 |
@gziolo I thought it was already the case 😬 It should be fixed. |
Let's give this a try and see how it goes. |
Builds on top of #29588
Extends that approach applied to headings to lists and paragraphs and also resets the "body" (editor-styles-wrapper) styles to the browser defaults. (There are still some styles on the editor-styles.scss files that I didn't check yet)
The idea now, is that by default if you use the "emptytheme", the frontend looks exactly like the backend by default and as you add styles to both your stylesheet (and loaded as part of the editor styles), the frontend/backend parity will persist.