BosNaufal / react-scrollbar

The Simplest Scroll Area Component with custom scrollbar for React JS. https://bosnaufal.github.io/react-scrollbar
MIT License
71 stars 30 forks source link

Allow usage without default css #17

Open alaindresse opened 7 years ago

alaindresse commented 7 years ago

Would it be possible to offer a mode without the default css ? When using react-create-app, the optimised build combines all imported css files and loads them before react-scrollbar imports its styles, so none of the style overrides work.

The workaround to add body before all my override classes works, but it would be nice to have a 'cleaner' solution.

usulpro commented 7 years ago

@alaindresse! Doesn't help using different classNames?

alaindresse commented 7 years ago

different classNames are similar (and certainly better) than my 'body' workaround. Will do it. But I still think it would be nice to avoid the default css if I don't need it (e.g. if I completely rewrite it). Having two entry points, one without the require(css), and one with just a require(css) followed by a require(non-css-version) would do the trick. For instance, your index.js could look like

import './style_default';
import ReactScrollbar from './react-scrollbar';
export default ReactScrollbar;

And you could have 'react-scrollbar.js' without the import './style_default for those that don't want the default css.

By the way, I would like to thank you for react-scrollbar. It's really great !

usulpro commented 7 years ago

Thank you, @alaindresse 👍 and I like your idea of two entry points

@BosNaufal do we implement this?