Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
postcss-color
Advanced tools
PostCSS plugin to transform latest W3C CSS color module syntax to more compatible CSS
PostCSS plugin to transform latest W3C CSS color module syntax to more compatible CSS.
This plugin can:
color()
to rgb()
(or rgba()
).#RRGGBBAA
or #RGBA
) to rgba()
.hwb()
to rgb()
(or rgba()
).rebeccapurple
to rgb()
.$ npm install postcss-color
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var color = require("postcss-color")
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
// process css
var output = postcss()
.use(color())
.process(css)
.css
Using this input.css
:
body {
background:
rgb(102, 51, 153)
linear-gradient(
color(rebeccapurple a(50%)),
hwb(0, 20%, 40%),
color(hwb(0, 20%, 40%, .5) a(+10%)),
color(#9d9c a(90%))
)
}
you will get:
body {
background:
rgb(102, 51, 153)
linear-gradient(
rgba(102, 51, 153, 0.5),
rgb(153, 51, 51),
rgba(153, 51, 51, 0.55),
rgba(153, 221, 153, 0.9)
)
}
Checkout tests for more examples.
color
(default: true
)Allow you to disable transformation of color()
hexAlpha
(default: true
)Allow you to disable transformation of #RRGGBBAA
or #RGBA
hwb
(default: true
)Allow you to disable transformation of hwb()
rebeccapurple
(default: true
)Allow you to disable transformation of rebeccapurple
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
$ git clone https://github.com/postcss/postcss-color.git
$ git checkout -b patch-1
$ npm install
$ npm test
1.0.0 - 2014-08-13
First release
FAQs
PostCSS plugin to transform latest W3C CSS color module syntax to more compatible CSS
The npm package postcss-color receives a total of 31 weekly downloads. As such, postcss-color popularity was classified as not popular.
We found that postcss-color 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
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.