Repository navigation
Description
Summary / Problem Statement
In Shopify Dawn, modular sections commonly used as hero banners or content blocks (slideshow, rich-text, image-banner, image-with-text, multicolumn, etc.) conflate visual typography sizing with semantic HTML heading structure.
Currently, theme settings only expose heading_size (h2, h1, h0, hxl, hxxl), which merely toggles CSS classes (e.g. .h1). The underlying HTML markup remains hardcoded as <h2> in Liquid templates.
The Merchant Dilemma: Duplicate Titles vs. Missing H1
When merchants build custom landing pages (page.*.json) or custom collection pages (collection.*.json), they frequently replace the default main-page or main-collection-banner section with a richer hero layout (such as a slideshow, image-banner, or rich-text block) to introduce the page:
- If
main-page/main-collection-banneris kept enabled: The page title is visually and semantically duplicated (e.g., once in the default banner and once in the hero section). - If
main-page/main-collection-banneris disabled: The page has no<h1>element at all, because all modular section headings hardcode<h2>. - If a visually-hidden
<h1>workaround is attempted: Screen reader users encounter duplicate heading announcements (e.g., Heading Level 1 "Summer Collection" immediately followed by Heading Level 2 "Summer Collection"), causing a degraded, confusing accessibility experience.
This leads to automated accessibility violations under WCAG 2.1 / 2.2 AA (1.3.1 Info and Relationships) and flags errors in auditing engines (e.g., Deque Axe-core page-has-heading-one and heading-order).
Describe the Expected Behavior
Merchants should be able to select the semantic HTML tag (<h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <div>) independently of the visual typography scale (heading_size).
- Semantic control: Configured via a
heading_tagselect setting in the block/section schema. - Visual control: Continues to be controlled via the existing
heading_sizeselect setting. - Backwards compatibility:
heading_tagdefaults toh2(or the section's existing default tag) across all stock sections so existing merchant templates remain 100% unaffected unless explicitly customized.
Technical Implementation / Proposed Solution
1. Schema Addition (Block or Section Settings)
Add a reusable heading_tag select setting to heading blocks and section headers:
{
"type": "select",
"id": "heading_tag",
"options": [
{ "value": "h1", "label": "H1" },
{ "value": "h2", "label": "H2" },
{ "value": "h3", "label": "H3" },
{ "value": "h4", "label": "H4" },
{ "value": "h5", "label": "H5" },
{ "value": "h6", "label": "H6" },
{ "value": "p", "label": "Paragraph" },
{ "value": "div", "label": "Div" }
],
"default": "h2",
"label": "Heading tag"
}2. Liquid Markup Dynamic Rendering
Replace hardcoded <h2> tags with dynamically assigned HTML tags:
sections/rich-text.liquid
- <h2 class="rich-text__heading rte inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
+ {%- assign heading_tag = block.settings.heading_tag | default: 'h2' -%}
+ <{{ heading_tag }} class="rich-text__heading rte inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
{{ block.settings.heading }}
- </h2>
+ </{{ heading_tag }}>sections/slideshow.liquid
- <h2 class="banner__heading inline-richtext {{ block.settings.heading_size }}">
+ {%- assign heading_tag = block.settings.heading_tag | default: 'h2' -%}
+ <{{ heading_tag }} class="banner__heading inline-richtext {{ block.settings.heading_size }}">
{{ block.settings.heading }}
- </h2>
+ </{{ heading_tag }}>sections/image-banner.liquid
- <h2 class="banner__heading inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
+ {%- assign heading_tag = block.settings.heading_tag | default: 'h2' -%}
+ <{{ heading_tag }} class="banner__heading inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
{{ block.settings.heading }}
- </h2>
+ </{{ heading_tag }}>sections/image-with-text.liquid
- <h2 class="image-with-text__heading inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
+ {%- assign heading_tag = block.settings.heading_tag | default: 'h2' -%}
+ <{{ heading_tag }} class="image-with-text__heading inline-richtext {{ block.settings.heading_size }}" {{ block.shopify_attributes }}>
{{ block.settings.heading }}
- </h2>
+ </{{ heading_tag }}>sections/multicolumn.liquid
- <h2 class="title inline-richtext {{ section.settings.heading_size }}">
+ {%- assign heading_tag = section.settings.heading_tag | default: 'h2' -%}
+ <{{ heading_tag }} class="title inline-richtext {{ section.settings.heading_size }}">
{{ section.settings.title }}
- </h2>
+ </{{ heading_tag }}>Affected Sections in Dawn
sections/slideshow.liquid(slideblock)sections/rich-text.liquid(headingblock)sections/image-banner.liquid(headingblock)sections/image-with-text.liquid(headingblock)sections/multicolumn.liquid(section header)sections/featured-collection.liquid(section header)sections/featured-blog.liquid(section header)sections/collage.liquid(section header)sections/collection-list.liquid(section header)
Standards, WCAG Compliance & References
- WCAG 2.1 / 2.2 Success Criterion 1.3.1 Info and Relationships (Level A): Requires programmatic heading structure to represent visual hierarchy and page context accurately.
- Deque Axe-core Rules:
page-has-heading-one: Ensures every page has exactly one top-level heading introducing the main content.heading-order: Ensures heading levels are logically ordered without skipping levels.
- Shopify Theme Store Requirement: Themes submitted to the Shopify Theme Store must satisfy WCAG 2.1 AA requirements.
Activity
[-]Decouple heading HTML tag semantics from visual size classes in modular Dawn sections[/-][+]Accessibility: Decouple heading HTML tag semantics from visual size classes in modular Dawn sections[/+]Decouple heading HTML tag semantics from visual size classes in modul…
Decouple heading HTML tag semantics from visual size classes in modul…
github-actions commentedon Nov 22, 2026
This issue has been marked as stale due to inactivity for 60 days. Please comment or update if this is still relevant, otherwise it will be closed in 7 days.
andywestley commentedon Nov 22, 2026