Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Customization: Add connectColor Option for Customizing Connected Section Colors #1288

Open
shirshak007 opened this issue Jan 8, 2025 · 0 comments

Comments

@shirshak007
Copy link

shirshak007 commented Jan 8, 2025

I propose adding a connectColor option to noUiSlider that allows users to customize the colors of the connected sections between slider handles. This would enable greater flexibility for styling the slider to match a website's design.

Option Behaviour:

  • Single String: If a single color is provided, it will be applied to all connected sections. Example : connectColor: '#ff5733'
  • Array of Strings: : If an array is provided, each color will be applied to the corresponding connected section between handles. For n handles there will be n+1 colors. Example : connectColor: '#FF5733', '#33FF57', '#3357FF', '#F1C40F', '#9B59B6']
  • If connectColor is not specified, the default color will be used.

Example Usage:

noUiSlider.create(sliderElement, {
    start: [20, 50, 70, 90],
    connect: [true, true, true, true, true],
    connectColor: '#ff5733',  // Single color for all connected sections
    // OR
    connectColor: ['#FF5733', '#33FF57', '#3357FF', '#F1C40F', '#9B59B6'],  // Different colors for each section
    range: {
        'min': 0,
        'max': 100
    }
});

Sample Image:

Screenshot of desired slider after adding colors between handles

I would be happy to contribute this feature if you're open to it and would appreciate any feedback or suggestions you have.

Thank you for considering this feature!

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

No branches or pull requests

1 participant