// with npm
npm install or-sample
// with yarn
yarn add or-sample
- Config webpack
sass-loader
if you are using webpack.
// webpack.config.js
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
],
include: [
/node_modules\/or\-\w+/ //include or-components
]
}
interface Props {
}
Customize in webpack
The following variables in or-sample can be overridden:
$or-btn-primary-color: $or-primary-color !default;
...
For more variables, see here.
Alternatively, you can override variables from or-theme to keep all or-components in a unified theme style.
First you should create a theme.scss
file to declare the variables you want to override.
Then use the data option provided by sass-loader
to override the default values of the variables.
We take a typical webpack.config.js
file as example to customize it's sass-loader options.
// webpack.config.js
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
data: fs.readFileSync(path.resolve(__dirname, 'theme.scss')) // pass theme.scss to sass-loader
}
}
],
include: [
/node_modules\/or\-\w+/ //include or-components
]
}
powered by storybook
MIT © foryuki