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

Allow usage without default css #17

Open
alaindresse opened this issue Feb 25, 2017 · 3 comments
Open

Allow usage without default css #17

alaindresse opened this issue Feb 25, 2017 · 3 comments

Comments

@alaindresse
Copy link

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
Copy link
Contributor

usulpro commented Feb 26, 2017

@alaindresse!
Doesn't help using different classNames?

@alaindresse
Copy link
Author

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
Copy link
Contributor

usulpro commented Feb 27, 2017

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

@BosNaufal do we implement this?

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

2 participants