You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blocks: Introduce separate stylesheet for editor with optional theme opt-in #2905
Many themes have styles for <hr> element so this will have styling issues with many themes. I propose removing styles from the front-end. Yeah I know then it would not match styles in the Gutenberg. That's something we need to solve.
I think we need to be really cautious removing all styling. A lot of themes to be honest do styling wrong. Offering some (note some) default styling is not a bad idea.
@samikeijonen yes, this one could potentially cause some unintended issues. Can we do a quick test through a few of the top themes to see if there are obvious things we can protect from? (The twenties, etc.)
As long as we only target the class, I think we can treat this separator as a special separator—unless, obviously, the theme wants to provide their own styles for it.
Can we do a quick test through a few of the top themes to see if there are obvious things we can protect from? (The twenties, etc.)
I can add screenshots here when I have some time. Twenty-* themes are not going to be problem though because we know to update and make small CSS tweaks to them before Gutenberg is released.
Could it be worth exploring the possibility of having the block class in the block section settings so users don't have to switch back to HTML to remove the class?
I think we should consider dropping automatic inclusion of some specific blocks styles that tend to always have theme styles (blockquote and hr would fall there).
changed the title [-]Blocks: Remove front-end styling from common theme blocks[/-][+]Blocks: Remove front-end styling from commonly theme-styled blocks[/+]on Mar 1, 2018
@aduth we have been reducing styles for many blocks in various releases, notably the quote styles. I think we need to regroup here and introduce the notion of core_block_styles which themes might opt into supporting via add_theme_support, since many themes do want our styles (specially new ones) but many others don't. The tricky bit is how to separate structure from visuals.
Maybe we should introduce another theme.scss for blocks (next to style.scss and edit.scss? Might give an easier way to also overwrite visuals within the editor without affecting structural styles.
changed the title [-]Blocks: Remove front-end styling from commonly theme-styled blocks[/-][+]Blocks: Introduce separate stylesheet for editor with optional theme opt-in[/+]on Mar 1, 2018
Maybe we should introduce another theme.scss for blocks (next to style.scss and edit.scss? Might give an easier way to also overwrite visuals within the editor without affecting structural styles.
I really like this idea and think going forward it solves a lot of issues.
Activity
karmatosed commentedon Oct 9, 2017
I think we need to be really cautious removing all styling. A lot of themes to be honest do styling wrong. Offering some (note some) default styling is not a bad idea.
samikeijonen commentedon Oct 9, 2017
That's a bold statement even for
<hr>styling. But like I said in other ticket I'm OK that all blocks have default styling.mtias commentedon Oct 10, 2017
@samikeijonen yes, this one could potentially cause some unintended issues. Can we do a quick test through a few of the top themes to see if there are obvious things we can protect from? (The twenties, etc.)
As long as we only target the class, I think we can treat this separator as a special separator—unless, obviously, the theme wants to provide their own styles for it.
samikeijonen commentedon Oct 10, 2017
I can add screenshots here when I have some time. Twenty-* themes are not going to be problem though because we know to update and make small CSS tweaks to them before Gutenberg is released.
oandregal commentedon Oct 26, 2017
FWIW, this also happens with the Independent Publisher theme.
oandregal commentedon Oct 26, 2017
Could it be worth exploring the possibility of having the block class in the block section settings so users don't have to switch back to HTML to remove the class?
mtias commentedon Oct 26, 2017
I think we should consider dropping automatic inclusion of some specific blocks styles that tend to always have theme styles (blockquote and hr would fall there).
aduth commentedon Mar 1, 2018
From the conversation, it appears there are two action items here:
styles.scssintoeditor.scss)styles.scssintoeditor.scss)Let me know if these are incorrect.
[-]Separator block markup in the front-end[/-][+]Blocks: Remove front-end styling from common theme blocks[/+][-]Blocks: Remove front-end styling from common theme blocks[/-][+]Blocks: Remove front-end styling from commonly theme-styled blocks[/+]mtias commentedon Mar 1, 2018
@aduth we have been reducing styles for many blocks in various releases, notably the quote styles. I think we need to regroup here and introduce the notion of
core_block_styleswhich themes might opt into supporting viaadd_theme_support, since many themes do want our styles (specially new ones) but many others don't. The tricky bit is how to separate structure from visuals.Maybe we should introduce another
theme.scssfor blocks (next tostyle.scssandedit.scss? Might give an easier way to also overwrite visuals within the editor without affecting structural styles.[-]Blocks: Remove front-end styling from commonly theme-styled blocks[/-][+]Blocks: Introduce separate stylesheet for editor with optional theme opt-in[/+]karmatosed commentedon Mar 2, 2018
I really like this idea and think going forward it solves a lot of issues.
mtias commentedon Mar 6, 2018
Closing in favor of #5360 as it has a wider overview.