Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@igor-lemon/craco-antd-scss
Advanced tools
Craco plugin for use SASS/SCSS in create-react-app projects
[![actions-workflow-test][actions-workflow-test-badge]][actions-workflow-test] [![release][release-badge]][release] [![license][license-badge]][license]
@igor-lemon/craco-antd-scss
is a Craco plugin which allows you to use SASS/SCSS in your create-react-app ^5.0.0
projects with Ant Design.
The plugin based on @igor-lemon/antd-scss-theme-plugin and craco-less plugins.
If you don't have craco
you should to install it before.
Then install @igor-lemon/craco-antd-scss
:
$ yarn add @igor-lemon/craco-antd-scss --save-dev
# OR
$ npm i @igor-lemon/craco-antd-scss --save-dev
Create theme.scss
. It's file where you can override antd variables.
And modify your craco.config.js
config file.
const CracoAntSCSSPlugin = require('@igor-lemon/craco-antd-scss');
module.exports = {
plugins: [
{
plugin: CracoAntSCSSPlugin,
options: { theme: './path_to/theme.scss' }
}
],
};
For example put into theme.scss
next variables
$primary-color: #92021F;
$link-color: #D3840D;
The list of variables you can find here: https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less
theme
lessOptions
Custom Less options. https://webpack.js.org/loaders/less-loader/#options
Default:
{}
Set null
if you don't want to apply @igor-lemon/antd-scss-theme-plugin
to the Less loader.
sassOptions
Custom SASS/SCSS options. https://webpack.js.org/loaders/sass-loader/#options
Default:
{}
Set null
if you don't want to apply @igor-lemon/antd-scss-theme-plugin
to the Less loader.
babelImportOptions
Babel Import plugin options.
Default:
{
libraryName: 'antd',
libraryDirectory: 'lib',
style: true
}
The plugin allows to use Ant Design variables in your SASS/SCSS files.
If you want to use it feature just import theme.scss
Example:
@import "./path_to/theme";
.wrapper {
background-color: $body-background;
margin: $margin-md;
}
The disadvantage of this approach is that the IDE and linters doesn't see the values of these variables. It may not be so convenient to use them.
My advice is to just overwrite the used variables in theme.scss
and set sassOptions
option to null
, this will reduce the rebuilding time.
const CracoAntSCSSPlugin = require('@igor-lemon/craco-antd-scss');
module.exports = {
plugins: [
{
plugin: CracoAntSCSSPlugin,
options: {
sassLoaderOptions: null,
theme: './path_to/theme.scss'
}
}
],
};
FAQs
Craco plugin for use SASS/SCSS in create-react-app projects
We found that @igor-lemon/craco-antd-scss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.