Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
postcss-prefixer
Advanced tools
A PostCSS plugin to prefix css selectors.
/* source css file */
#selector { /* content */ }
.selector { /* content */ }
.selector:hover { /* content */ }
.selector__element { /* content */ }
/* output css file prefixed with "prfx__" */
#prfx__selector { /* content */ }
.prfx__selector { /* content */ }
.prfx__selector:hover { /* content */ }
.prfx__selector__element { /* content */ }
npm i -D postcss postcss-prefixer
or yarn add -D postcss postcss-prefixer
create a postcss.config.js
with:
module.exports = {
plugins: [
require('postcss-prefixer')({ /* options */ })
]
}
Refer to PostCSS Usage on how to use it with your preferred build tool.
const postcss = require('postcss');
const prefixer = require('postcss-prefixer');
const input = fs.readFileSync('path/to/file.css', 'utf-8');
const output = postcss([
prefixer({
prefix: 'prefix-',
ignore: [ /selector-/, '.ignore', '#ignore' ]
})
]).process(input);
Name | Description |
---|---|
prefix (string) | prefix value to be used |
ignore (array) | list of selectors to ignore, accepts regex |
Plugin based on postcss-class-prefix create by thompsongl.
FAQs
postcss plugin to prefix all css selector classes and ids
The npm package postcss-prefixer receives a total of 12,099 weekly downloads. As such, postcss-prefixer popularity was classified as popular.
We found that postcss-prefixer 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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.