KyleAMathews / react-headroom

Hide your header until you need it
https://kyleamathews.github.io/react-headroom
MIT License
1.83k stars 149 forks source link

Add possibility to set class names #104

Open vladshcherbin opened 7 years ago

vladshcherbin commented 7 years ago

Currently the classes are hardcoded, it would be great if we could change them.

KyleAMathews commented 7 years ago

What's your usecase?

vladshcherbin commented 7 years ago

@KyleAMathews we are using classes for styling and have a convention to name them as .headroom-unfixed.

Benjamin-Dobell commented 6 years ago

@KyleAMathews

What's your usecase?

As a general rule libraries (React or otherwise) shouldn't enforce global CSS names because:

The last point essentially makes this library incompatible with common theming engines found in libraries like material-ui, and is the issue I ran into.

I would appreciate it if you could review and ideally merge https://github.com/KyleAMathews/react-headroom/pull/124

designbyadrian commented 5 years ago

Please see react-autosuggest: https://github.com/moroshko/react-autosuggest#theme-prop

I'm using CSS Modules, which means that I currently have to put all headroom CSS styles in a global stylesheet, which I don't want. By being able to configure class names, I can keep the style definitions in my CSS module files.