rcaferati / react-awesome-slider

React content transition slider. Awesome Slider is a 60fps, light weight, performant component that renders an animated set of production ready UI general purpose sliders with fullpage transition support for NextJS and GatsbyJS. 🖥️ 📱
https://fullpage.caferati.me
MIT License
2.94k stars 295 forks source link

Set SASS constants values as "default" #148

Closed djr3 closed 4 years ago

djr3 commented 4 years ago

It allows easier customization for SASS users, they will only need to override the variables and import the compiled styles.

/* CustomSlider.module.sass */
$variable-to-override: variable-value
@import "react-awesome-slider/src/core/styles.scss"

Also, In contexts like NextJS app (> v.9.4) which provides code splitting out of the box, styles can either be imported globally in the custom "_app.js" (causing useless overload in pages where the slider component is not rendered) or at component level via modules.

import CustomSliderSyles from "./CustomSlider.module.sass"

export const CustomSlider = () => {
 <AwSlider cssModule={CustomSliderStyles}>
}