Problem/Motivation

An axe-core scan of a Varbase Starter homepage reports page-has-heading-one (moderate): the page has no top-level h1.

Measured on a running Varbase Starter site: zero h1 elements. The first heading is the hero headline, rendered as

<h2 class="hero-slider__title h1 mb-3">Varbase, better than ever</h2>

It carries the h1 class, so it is styled as the page heading while being marked up as h2. A Canvas landing page renders no page-title block, so nothing else supplies an h1.

content/canvas_page/01-home.yml has no component at level: 1. Its hero is a hero-slider-container with four slides, each pinned to title_tag: h2, and everything below is level: 2 or 3. content/canvas_page/02-blog.yml has the same gap and fails the same rule.

The recipe's inner pages already do this correctly: 03-contact-us.yml, 04-about-varbase.yml and 05-features.yml each carry one level: 1. Only the home and blog pages are missing it.

Why the fix does not belong in the theme

Neither hero component can safely supply a page-level h1, and #3621197 deliberately descoped it after trying:

  • A hero slider can hold several slides. If the slide's title tag offered h1, a multi-slide hero would emit several h1 elements, trading one violation for another. The component cannot know how many siblings it has.
  • hero-slider-container has no title, heading or level prop at all, so there is no container-level heading to use.
  • A card is never a page's main heading, so card-hero must not offer h1 either.
  • Every heading-bearing component in the theme caps at h2 by design. Only the heading atom emits a semantic h1, via level: 1.

Steps to reproduce

  1. Install Varbase Starter and open the homepage.
  2. Run an axe-core scan, or evaluate document.querySelectorAll('h1').length. It is 0.
  3. Repeat on the blog page. Same result.

Proposed resolution

Place the heading component at level: 1 in the hero section of content/canvas_page/01-home.yml, and do the same for 02-blog.yml.

This is the pattern the sibling site templates already ship, so it is a known-good shape rather than a new one. Horizon Aid does it at horizonaid/content/canvas_page/01-home.yml lines 72 to 78, placing sdc.vartheme_bs5_horizonaid.heading with level: 1 and text_size: h1 inside the hero banner's content slot; all eight of its pages carry exactly one level: 1. Educare does the same across all twelve of its pages.

Use level: 1 for the semantics and a text_size that preserves the current visual weight, so the design does not change.

Remaining tasks

  • ✅ File an issue
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Release

User interface changes

  • None intended. The heading is added at the semantic level only; the rendered size should be unchanged.

API changes

  • None.

Data model changes

  • None. Default content only.

Release notes snippet

  • Give the home and blog pages a top-level h1, so a Varbase Starter site passes the page-has-heading-one accessibility check.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed 33da4c5d on 1.0.x
    fix: #3621200 Add a site name level 1 heading to the Varbase Starter...
rajab natshah’s picture

Status: Active » Fixed
Issue tags: +varbase_starter-1.0.0

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.