Skip to content

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

Merged
oliverfoster merged 7 commits into
masterfrom
issue/233
Apr 13, 2026
Merged

New: Add classes and spans for prefixes / suffixes (fixes #233)#234
oliverfoster merged 7 commits into
masterfrom
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 👍

@oliverfoster oliverfoster merged commit a66c32c into master Apr 13, 2026
@oliverfoster oliverfoster deleted the issue/233 branch April 13, 2026 09:13
@github-project-automation github-project-automation Bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 13, 2026
github-actions Bot pushed a commit that referenced this pull request Apr 13, 2026
# [4.10.0](v4.9.0...v4.10.0) (2026-04-13)

### Chore

* Bump js-yaml from 4.1.0 to 4.1.1 (#225) ([87eecb3](87eecb3)), closes [#225](#225)
* Bump lodash from 4.17.21 to 4.17.23 (#224) ([458b441](458b441)), closes [#224](#224)
* Bump lodash-es from 4.17.21 to 4.17.23 (#223) ([3f7faf1](3f7faf1)), closes [#223](#223)

### New

* Add classes and spans for prefixes / suffixes (fixes #233) (#234) ([a66c32c](a66c32c)), closes [#233](#233) [#234](#234)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 4.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

Status: Recently Released

Development

Successfully merging this pull request may close these issues.

Add modifier classes when scaleStepPrefix or scaleStepSuffix are set

3 participants