Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
extract-styles
Advanced tools
Extract-styles creates a theme package with lines from your SCSS files marked with // @theme
A node tool to generate a theme from SCSS files.
Extract-styles analyzes input SCSS files and extracts all definitions marked with a special 'theme' comment.
You can later load the resulting theme file, set the theme class on the body/root of the page to apply the new styles.
Write your SCSS as you'd normally do, but mark the lines required in the theme file with @theme
:
.foo {
width: 100%;
color: #ffff00; // @theme
font-weight: bold;
border: 1px solid #ff0000; // @theme
&__content {
padding: 10px;
background-color: #eee; // @theme
}
}
After running extract-styles
, you'll get a theme file with the marked lines extracted:
.theme-default {
.foo {
color: #ffff00;
border: 1px solid #ff0000;
&__content {
background-color: #eee;
}
}
}
$ npm install extract-styles --save-dev
Start the CLI and progress step-by-step with style extraction:
$ ./node_modules/.bin/extract-styles
Combine the following options to use with watchers (npm-watch
or nodemon
):
$ ./node_modules/.bin/extract-styles --root src --output src/themes/theme.scss --template t.tpl --mark @myTheme
--root Define the root directory to start searching for SCSS files.
--output The resulting SCSS theme file. Supply full path with filename and scss extension.
--template Custom template for generating the theme file. Useful when you want to include imports.
--mark Define a custom theme mark. It can be any string that will be unique for marking theme lines. (Default: @theme).
PRs are much appreciated!
Use npm start
while coding and npm test
to run unit tests.
MIT © Marton Czebe
FAQs
Extract-styles creates a theme package with lines from your SCSS files marked with // @theme
The npm package extract-styles receives a total of 0 weekly downloads. As such, extract-styles popularity was classified as not popular.
We found that extract-styles 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.