-
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
Cover Block: Unnecessary default styles for H2 heading #17704
Comments
I guess this is probably a leftover from the initial implementation of the Cover block (without nesting). is that right? cc @jorgefilipecosta |
Bug 1: H2 Heading is centered, but not selected as centered. |
Hi @youknowriad exactly these styles exist because of a previous version of a cover block. But they are not a leftover they were intentionally left because without them old cover blocks would not work. Cover block suffered lots of changes I guess we need a better way to organize its styles and clearly indicate what is a deprecation and what is not. And we will need a way to relying on the previous markup still keep styles on working when in the presence of the old markup but not affect the new markup. |
@jorgefilipecosta I can not imagine that this old style can be organized in such a way that it does not always override the theme style. Supporting older versions unnecessarily inflates the code. The theme comes with a style like:
Any other CSS assignment like the following will override this theme style.
Is there a way? I think this old cover block h2 css code is useless :-) |
Hi @CreativeDive I created a PR that solves this issue:
I relied on some differences between the old markup and the new.
Unfortunately, we can not remove CSS for older versions otherwise during an upgrade old blocks would stop working or their design would be changed. |
@jorgefilipecosta Good job! I will test it after the release of Gutenberg 6.7. |
Hey,
the cover block comes with the following unnecessary default styles:
.wp-block-cover-image .wp-block-cover-image-text, .wp-block-cover-image .wp-block-cover-text, .wp-block-cover-image h2, .wp-block-cover .wp-block-cover-image-text, .wp-block-cover .wp-block-cover-text, .wp-block-cover h2 { color: #fff; font-size: 2em; line-height: 1.25; z-index: 1; margin-bottom: 0; max-width: 610px; padding: 14px; text-align: center; }
This default styles are only matched to
h2
but noth1, h3, h4, h5, h6
. I'm interested why theh2
needs a default style?Please remove this unnecessary
h2
default style from cover block. This formatting should be added by the theme only.The text was updated successfully, but these errors were encountered: