rrutsche / react-parallax

A React Component for parallax effect
MIT License
855 stars 76 forks source link

Allow for bgMax and bgMin width and height #54

Closed Dcorkran closed 5 years ago

Dcorkran commented 5 years ago

Thanks for the great lib! Saved me a ton of time.

rrutsche commented 5 years ago

Hey, thanks for contribution. I think it makes sense to have a more generic way for background image styling. Maybe we should add a bgImageStyle prop that can include all needed styles => <Parallax bgImageStyle={{minWidth: '100px', maxHeight: '300px', opacity: 0.7 ...}}>... And inside the render function we could add this to the image like style={{ ...this.state.imgStyle, ...this.props.bgImageStyle }} This way we can add way more styles without having to define it as additional prop.

Dcorkran commented 5 years ago

Sounds like a much better solution. I should be able to update the pr within a day or so