stbaer / rangeslider-js

Lightweight rangeslider with touch support
http://stbaer.github.io/rangeslider-js/
MIT License
45 stars 13 forks source link

CSS Injection (optional) #3

Closed dvlden closed 8 years ago

dvlden commented 8 years ago

I see that your script automatically adds/injects the CSS, tho I'd like to write my SASS styling that I can reuse with ease for other projects with your module.

Is it possible that you make this as option, such as:

rangeSlider.create(selector, {
    injectStyle: false // default true
});

Although you could also simply separate styling from JS and don't inject it at all. If there's a workaround let me know.

stbaer commented 8 years ago

Hi dvLden, the main reason for injecting the css is that it's very convenient to use with browserify for example. And it's only a bit more than 60 lines of css, so it doesn't have a big impact on the size. Would overwriting the styles be an option for you?

dvlden commented 8 years ago

I simply commented out that require() of CSS at the top of your script and it seem to have no problems at all.

stbaer commented 8 years ago

Are you using browserify or some other module loader? If yes you can probably just exclude the css in the build options.

dvlden commented 8 years ago

Yes, I am using Browserify. I'll check that one out (Y)

gcphost commented 8 years ago

Using webpack here but did the same thing, commented out the require. I could extract it to a bundle but I want all my CSS in one place.

stbaer commented 8 years ago

Not sure about webpack, but I know with browserify there's an exclude option to skip modules that are not supposed to be in the build. Let me know if that works for you.

browserify ignore/exclude

stbaer commented 8 years ago

👍 Closing this for now, feel free to reopen if excluding doesn't work.