Skip to content

New: Add classes and spans for prefixes / suffixes (fixes #233)#234

Open
swashbuck wants to merge 7 commits intomasterfrom
issue/233
Open

New: Add classes and spans for prefixes / suffixes (fixes #233)#234
swashbuck wants to merge 7 commits intomasterfrom
issue/233

Conversation

@swashbuck
Copy link
Copy Markdown
Contributor

@swashbuck swashbuck commented Apr 1, 2026

Fixes #233

New

  • When scaleStepPrefix or scaleStepSuffix are set, has-scale-step-prefix and has-scale-step-suffix modifier classes are now added, giving theme authors a useful CSS hook.
  • Prefix and suffix values are now wrapped in <span> elements in all three visible render locations: scale number labels, correct answer range indicator, and selected value indicator
  • The span wrappers enable targeted styling like hiding on small screens via media queries (e.g. showing $5 on desktop but just 5 on mobile). This would need to be customized by the theme author, though.

Testing

  1. Configure a slider with scaleStepPrefix (e.g. $) and/or scaleStepSuffix (e.g. days)
  2. Verify the prefix/suffix text is wrapped in the expected span elements in the DOM
  3. Verify has-scale-step-prefix / has-scale-step-suffix classes appear on slider__widget
  4. Verify aria label strings are unaffected (prefix/suffix still render as plain text in screen reader spans)
  5. Verify a slider with no prefix/suffix is unchanged — no extra spans or classes

Related

adaptlearning/adapt-contrib-vanilla#592 - Adds improved styling when prefixes and suffixes are present.

Posted via collaboration with Claude Code

@swashbuck swashbuck self-assigned this Apr 1, 2026
@swashbuck swashbuck moved this from New to Assigned in adapt_framework: The TODO Board Apr 1, 2026
@swashbuck swashbuck moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board Apr 1, 2026
@swashbuck swashbuck changed the title New: Add modifier classes and span wrappers for scaleStepPrefix/scaleStepSuffix (fixes #233) New: Add classes and spans for prefixes / suffixes (fixes #233) Apr 1, 2026
Copy link
Copy Markdown
Contributor

@kirsty-hames kirsty-hames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected thanks with no impact on SR experience 👍

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

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Add modifier classes when scaleStepPrefix or scaleStepSuffix are set

3 participants