
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
postcss-bad-selectors
Advanced tools
Checks selectors according to the CSS standards of 2create.
PostCSS plugin that slaps you, if you write wrong selectors.
npm install postcss-bad-selectors
var path = require('path');
var postcss = require('postcss');
var bad = require('postcss-bad-selectors');
postcss([bad(getToken)])
.process(css, { from: './css/_module.logo.css' })
.catch(function(err) {
console.log(err); // Wrong selector error
})
function getToken(file) {
var file = path.basename(file);
var prefixRegex = /^_module/gi;
var token = null;
if (prefixRegex.test(file)) {
token = file.replace(prefixRegex, '');
token = path.basename(token, '.css');
}
return token; // 'Valid CSS selector e.g. _module.logo.css => .logo'
}
Note: getToken
can return String
or RegExp
.
.logo {}
.wrapper .logo-blue {}
postcss-bad-selectors: /Users/john/Server/project/css/_module.logo.css:8:2: Wrong selector
@media (max-width: 767px) {
.logo,
^
.wrapper .logo-blue {}
Pull requests are welcome.
MIT © 2createStudio
FAQs
Checks selectors according to the CSS standards of 2create.
The npm package postcss-bad-selectors receives a total of 0 weekly downloads. As such, postcss-bad-selectors popularity was classified as not popular.
We found that postcss-bad-selectors 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.