Skip to content

Range input: Add a workaround to enable track color#37499

Closed
louismaximepiton wants to merge 6 commits into
twbs:mainfrom
louismaximepiton:main-lmp-input-range-fix
Closed

Range input: Add a workaround to enable track color#37499
louismaximepiton wants to merge 6 commits into
twbs:mainfrom
louismaximepiton:main-lmp-input-range-fix

Conversation

@louismaximepiton

@louismaximepiton louismaximepiton commented Nov 16, 2022

Copy link
Copy Markdown
Member

Description

Wanted to add a workaround to add some color on the track part on the range input. I would be fine if this is not planned in Bootstrap, but I couldn't spot any issue/PR about it.

Motivation & Context

Could help folks to implement this functionnality.

Type of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

NA

@ffoodd ffoodd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few questions here and there! Regarding content, I think the --value custom property should be mentionned somewhere since it's what does the trick so affordable.
Any thought?

Comment thread site/assets/scss/_component-examples.scss
Comment thread site/content/docs/5.2/forms/range.md Outdated
@louismaximepiton

Copy link
Copy Markdown
Member Author

Regarding the --value, do you think it should be prefixed by bs- ? Tried some things one last commit to make --value more visible in the doc.

Comment thread site/content/docs/5.2/forms/range.md Outdated
Comment thread site/content/docs/5.2/forms/range.md Outdated
@mdo

mdo commented Dec 29, 2022

Copy link
Copy Markdown
Member

Do we still want this @julien-deramond?

@julien-deramond

Copy link
Copy Markdown
Member

Do we still want this @julien-deramond?

Might be some things to tweak here and there in this PR but on my side I like the idea to provide a solution for folks out there totally optional that isn't embedded directly within the library.

@mdo

mdo commented Feb 14, 2023

Copy link
Copy Markdown
Member

Tried rebasing this and making it work again, but ran into an issue with the custom color not working. Might've been a bad rebase or merge, but want to take a crack at it @louismaximepiton? Happy to see this section added.

@coliff

coliff commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

This is really great! I'd like to see this added to the site too (and maybe added to v6 Bootstrap JS?).

One thing to note though, for disabled ranges using this method you need to add CSS to override it. I just used this but there might be a better way:

.form-range:disabled {
  filter: grayscale(100%);
}

@mdo

mdo commented Jun 21, 2026

Copy link
Copy Markdown
Member

This is now coming in v6. #42525.

@mdo mdo closed this Jun 21, 2026
@github-project-automation github-project-automation Bot moved this from Needs review to Done in v5.4.0 Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants