Skip to content
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

Remove sub heading #9308

Closed
karmatosed opened this issue Aug 24, 2018 · 9 comments · Fixed by #9355
Closed

Remove sub heading #9308

karmatosed opened this issue Aug 24, 2018 · 9 comments · Fixed by #9355
Labels
[Feature] Blocks Overall functionality of blocks

Comments

@karmatosed
Copy link
Member

Right now the sub heading has a few issues and isn't really solving many that other blocks don't. The original idea was to literally be a sub title that had a single use. This has now become something people both want in multiple places to use and grown beyond that intent. As we have headings and you can do styling with text, we no longer need this block. It's also not super understood as to the original intent.

I am going to suggest we for now remove this block. I do understand some already use it and the fallback should be a heading block, ideally a lower number than h4 to get size and not have SEO implications (which already are confusing with this block).

@karmatosed karmatosed added the [Feature] Blocks Overall functionality of blocks label Aug 24, 2018
@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Aug 24, 2018

I do not think the fallback should be a Heading block. Semantically, the closest thing in Gutenberg to a subheading would be a Paragraph block with a style variation or just font-style: italic set in its style attribute. You are not supposed to skip heading elements and go from <h1> to <h3> unless the <h3> is in an explictly-created 2nd-level section created with a <section>.

But yes, the Subheading block should be removed. The proper way to have subheadings is like so:

<article>
	<header>
		<h1>Document title</h1>
		<p>Subheading</p>
	</header>
	<section>
		<header>
			<h1>Section heading</h1> <!-- yes, you can use <h1>s here -->
			<p>Section subheading</p>
		</header>
		<p>Section content</p>
	</section>
	<section>
		<header>
			<h1>Another section heading (equivalent of an h2</h1> with no section elements)</h1>
			<p>Another section subheading</p>
		</header>
		<section>
			<header>
				<h1>Sub-section heading (equivalent of an h3</h1> with no section elements)
				<p>Sub-section subheading</p>
			</header>
			<p>Sub-section content</p>
		</section>
		<p>Section content</p>
	</section>
</article>

Of course, you can not use <header> elements for sections unless they are nested in a <section> element, and so since Gutenberg currently lacks a Container block, there is no way to have a proper subheading in the post content.

@sarahmonster
Copy link
Member

YES YES YES YES.

💯🔥❤️💯🔥❤️💯🔥❤️💯🔥❤️💯🔥❤️💯🔥❤️

@chrisvanpatten
Copy link
Member

Without rehashing the semantics of why subheads are paragraphs, I also agree that leftover subheads shouldn’t be transformed to an h4. That would be an unexpected change in semantics for content that has already been created.

They’re already rendered as a paragraph; why not simply transform them to a normal paragraph, and apply wp-block-subhead as a custom CSS class? That would keep styles consistent for users who’ve already styled around that CSS class as well which would be a nice bonus and the smoothest possible transition path.

@chrisvanpatten
Copy link
Member

Also I’m not sure it actually requires a true fix for #8141 because the change would be in a deprecated handler, right? Users wouldn’t be asked to manually transform their leftover subheads. (Right...?)

@0aveRyan
Copy link
Contributor

Agreed that they can't necessarily transform directly into a Heading. Some recent discussion on this in #9179.

@ZebulanStanphill
Copy link
Member

@chrisvanpatten Yeah, the Subheading blocks should at worst be transformed into Classic blocks which should then be able to be converted into Paragraph blocks.

@tofumatt
Copy link
Member

tofumatt commented Aug 24, 2018

Also I’m not sure it actually requires a true fix for #8141 because the change would be in a deprecated handler, right? Users wouldn’t be asked to manually transform their leftover subheads. (Right...?)

Oh, right. Yeah, okay, that makes sense. I've updated the comment 😄

@karmatosed
Copy link
Member Author

My thinking in suggesting a heading was what some people may use it for. Also very ok with it being a paragraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants