Make javascript markup themeable

Created on 1 May 2025, 15 days ago

Problem/Motivation

The current javascript outputs h2 elements that may or may not fit into a page's hierarchy.

Steps to reproduce

Use the module normally.

Proposed resolution

Rather than change one set of hardcoded markup for another as in issue 3503730 🐛 A11y: aria-label approach to improve label accessibility, remove hardcoded heading levels Active , I'd suggest outputting the markup using Drupal.theme(). That way, implementations can alter the markup in any way they choose.

Issue 3503730's role attribute would, I think, make a useful additions to the defaults.

Remaining tasks

  1. make the script into a Drupal behavior instead of using document ready (Drupal.theme() implementations won't be overrideable without doing this)
  2. create an appropriate Drupal.theme() function in the module
  3. replace the javascript markup with calls to the new functions

User interface changes

N/a

API changes

N/a

Data model changes

N/a

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France bedlam Lyon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024