Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
postcss-autoreset
Advanced tools
PostCSS plugin for automatic conditional rules reset. Useful for creation of bullet-proof styles isolation in your extension. Can be used in combination with postcss-initial.
The following CSS is written in BEM notation.
.block {
padding: 1em;
}
.block:hover {
background-color: red;
}
.block__element {
margin: 1em;
}
.block--modifier {
border: 1em;
}
.block,
.block__element {
/* combined reset block */
all: initial;
}
.block {
/* reseted */
padding: 1em;
}
.block:hover {
/* ignored, we don`t need to reset pseudoclasses */
background-color: red;
}
.block__element {
/* reseted */
margin: 1em;
}
.block--modifier {
/* ignored, we don`t need to reset BEM modifiers */
border: 1em;
}
Set of properties that we use to reset rules.
Takes string
or object
.
Possible values:
all: initial
;Use object to create your own reset. CSS-in-JS notation is supported.
Example
postcss([
require("postcss-autoreset")({
reset: {
margin: 0,
padding: 0,
borderRadius: 0,
},
}),
]);
Rules filter function.
Takes string
or function
.
Possible values:
.block__element-modifier
);You can define custom rules filter to fit your styles naming.
Example
postcss([
require("postcss-autoreset")({
rulesMatcher: (rule) => rule.selector.match(/regexp/),
}),
]);
Reset only simple rules. See #28
postcss([
require("postcss-autoreset")({
rulesMatcher: (rule) => rule.selector.match(/^[.]\w+$/),
}),
]);
Step 1: Install plugin:
npm install --save-dev postcss postcss-autoreset
Step 2: Check you project for existed PostCSS config: postcss.config.js
in the project root, "postcss"
section in package.json
or postcss
in bundle config.
If you do not use PostCSS, add it according to official docs and set this plugin in settings.
Step 3: Add the plugin to plugins list:
module.exports = {
plugins: [
+ require('postcss-autoreset')(),
require('autoprefixer')
]
}
[3.0.4] - 2020-05-21
FAQs
PostCSS plugin for partial styles reset
The npm package postcss-autoreset receives a total of 1,485 weekly downloads. As such, postcss-autoreset popularity was classified as popular.
We found that postcss-autoreset demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.