Skip to content

Add stable Accordion CSS hooks (RapidWeaver #4467) - #123

Draft
Tpbradley wants to merge 1 commit into
mainfrom
cursor/accordion-css-hook-4467-7642
Draft

Tpbradley wants to merge 1 commit into
mainfrom
cursor/accordion-css-hook-4467-7642

Conversation

@Tpbradley

Copy link
Copy Markdown
Contributor

Summary

Fixes a Core Pack regression that broke site-wide custom CSS targeting Accordion identity attributes after Elements 3.0.10.

Related: RapidWeaver #4467

PR #118 (a03f7e1) correctly removed role="group", aria-roledescription="accordion", and aria-label="Accordion section …" (raw node id) for keyboard a11y. That also removed the only stable Accordion identity hooks some site-wide custom CSS relied on.

Change

On the Accordion root (hooks.source.js / built hooks.js):

  • Add class rw-accordion
  • Add attribute data-rw-accordion

CSS can target either .rw-accordion or [data-rw-accordion].

Explicitly not restored

Preserved from #118

  • tabindex="0" on summary (preview mode)
  • @keydown.enter.prevent / @keydown.space.prevent
  • focus-visible ring classes

Core Pack only — no RapidWeaver app / wrapper changes.

Test plan

  • node --test test/accordion-component.test.mjs (hooks emit both CSS hooks; no restored ARIA identity; focus-visible classes remain)
  • Spot-check Accordion export markup includes class="… rw-accordion …" and data-rw-accordion
  • Keyboard: Tab reaches header; Enter/Space toggles; focus ring on keyboard only
Open in Web Open in Cursor 

PR #118 removed role/aria-roledescription/aria-label identity attrs for
keyboard a11y, which broke site-wide CSS that targeted those hooks
(RapidWeaver #4467). Add data-rw-accordion and .rw-accordion on the root
as a non-ARIA compat shim without restoring the a11y-problematic attrs.

Co-authored-by: Tom Bradley <Tpbradley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants