Gutenberg: Remove sub heading

Created on 24 Aug 2018  路  9Comments  路  Source: WordPress/gutenberg

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).

[Feature] Blocks

Most helpful comment

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

They鈥檙e 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鈥檝e already styled around that CSS class as well which would be a nice bonus and the smoothest possible transition path.

All 9 comments

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.

Fixing this will:

  • close #8716
  • close #8234
  • requires we fix #8141 close #8141
  • close #5475

YES YES YES YES.

馃挴馃敟鉂わ笍馃挴馃敟鉂わ笍馃挴馃敟鉂わ笍馃挴馃敟鉂わ笍馃挴馃敟鉂わ笍馃挴馃敟鉂わ笍

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

They鈥檙e 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鈥檝e already styled around that CSS class as well which would be a nice bonus and the smoothest possible transition path.

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

Agreed that they can't necessarily transform directly into a Heading. Some recent discussion on this in https://github.com/WordPress/gutenberg/pull/9179.

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronjorbin picture aaronjorbin  路  3Comments

mhenrylucero picture mhenrylucero  路  3Comments

wpalchemist picture wpalchemist  路  3Comments

ellatrix picture ellatrix  路  3Comments

franz-josef-kaiser picture franz-josef-kaiser  路  3Comments