Skip to content

[EuiTourStep] Subtitle shouldn't be a h1 #4843

Closed

Description

@elizabetdev

The subtitle of the EuiTourStep shouldn't be a <h1 />.

<EuiPopoverTitle className="euiTourHeader" id={titleId}>
<EuiTitle size="xxxs" className="euiTourHeader__subtitle">
<h1>{subtitle}</h1>
</EuiTitle>
<EuiTitle size="xxs" className="euiTourHeader__title">
<h2>{title}</h2>
</EuiTitle>
</EuiPopoverTitle>

Also, are there better HTML semantics to improve this title/subtitle section? CC @myasonik

Activity

  1. myasonik commented on Jun 1, 2021

    @myasonik
    Contributor

    🤔 As usual... It depends.

    If it's truly a subtitle and title
    So, generally, a subtitle should be a <p> immediately after a heading (any <h#>). So if we wanted to visually put the sub-title above the heading, I'd flip it with CSS (flex-direction: column-reverse or something like that).

    An example of a title with a subtitle could be:

    h1: Learning about web accessibility
    p: Or, how I stopped worrying about ARIA and embrace HTML
    

    If it's truly a heading and a lower level heading
    But... I went looking in the docs and it looks like the intend use of {subtitle} is to be the title of the tour overall, not actually to be a subtitle to the individual tour step.

    If that's the case, I'd drop the h1 to an h2 and the h2 to an h3 and that's probably all that needs to happen.

    An example of a heading and lower level heading:

    h2: Learning about web accessibility
    h3: History of ARIA
    

    If we're not sure and we need to support both
    No great answer here. Probably just need to go with whichever pattern we think will be most common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions