
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.
bettercss-preprocessor
Advanced tools
CSS preprocessor for BetterCSS built with PostCSS.
npm i --save bettercss-preprocessor
Process via command line
bettercss input.css output.css [options]
var postcss = require('postcss'),
bettercss = require('bettercss');
postcss([ bettercss() ])
.process(css, { from: 'input.css', to: 'output.css' })
.then(function (result) {
fs.writeFileSync('output.css', result.css);
});
Consume local files, node modules or bower packages.
@import './style.css';
@import 'module'; /* == @import "./node_modules/module/index.css"; */
Plugin: postcss-import
Parse CSS and add vendor prefixes to CSS rules using values from Can I Use.
.flex {
display: flex
}
.flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
Plugin: Autoprefixer
Transforms CSS Custom Properties(CSS variables) syntax into a static representation.
:root {
--example: red;
}
.example {
color: var(--example);
}
Plugin: postcss-css-variables
Reduces calc() references whenever it's possible
.example {
color: calc(20px + 20px);
}
Plugin: postcss-calc
Transforms W3C CSS Custom Media Queries syntax to more compatible CSS.
@custom-media --small-viewport (max-width: 30em);
@media (--small-viewport) {
/* styles for small viewport */
}
Plugin: postcss-custom-media
Usage: bettercss [<input>] [<output>]
Options:
-h, --help output usage information
-V, --version output the version number
-s, --sourcemap enable source maps
Examples:
# Pass an input and output file:
$ bettercss input.css output.css
# Enable source maps:
$ bettercss input.css output.css --sourcemap
All features in BetterCSS can be toggled on or off by passing options. By default all core features are set to true.
.bettercss({
// options
});
FAQs
A modular processor for bettercss
The npm package bettercss-preprocessor receives a total of 2 weekly downloads. As such, bettercss-preprocessor popularity was classified as not popular.
We found that bettercss-preprocessor 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.