avanes / postcss-color-alpha Goto Github PK
View Code? Open in Web Editor NEWPostCSS plugin to transform color from #rgb.a to rgba()
License: MIT License
PostCSS plugin to transform color from #rgb.a to rgba()
License: MIT License
it('converts mixed `#rgb`, `#rgb.a`, `black()`, `white` to propper rgba in series', function () {
test('div{ border-color: #0fc #000.2 white(.3) black }', 'div{ border-color: #0fc rgba(0, 0, 0, 0.2) rgba(255, 255, 255, 0.3) black }');
});
Sorry, I didn’t investigate this issue yet.
Input:
background: #004400 radial-gradient(white(0.05), white(0))
Output (according Chrome DevTools):
background: #004400 rgba(255, 255, 255, 0.05) white(255, 255, 255, 0)
Seems like plugin broke radial-gradient
word.
/cc @avanes
Please send a PR to PostCSS README.md with your plugin in list.
Is rgba(hex, 0) not supported for a reason or is it a bug?
https://github.com/avanes/postcss-color-alpha/blob/master/index.js#L144
Thanks.
This is not working for me. It is changing
.background {
background-color: #121519.3;
}
to
.background {
background-color: #121519 0.3;
}
It does not work with rgba(rgb(51, 113, 113), 0.4)
.
Of course, this example looks wierd on first look, but postcss-color-function
return all colors in rgb()
, so it is useful case.
/cc @avanes
Does #0fc 0.3
is safe? Maybe #0fc0.3
?
PostCSS Plugin Guidelines are mandatory right now. Because all of rules are about ecosystem health.
Haven’t been able to get this to work with the postcss-simple-vars extension.
Trying to do something along the lines of $pale-color: rgba($bright-color, .5);
but no variation of the syntax seems to product the desired output.
Please, publish npm package by npm publish
. I want to use your plugin on Amplifr.
Hi, love the plugin. Is it possible to use this alongside a CSS Custom Property/Variable for example
box-shadow: 0 0 4px 0 var(--dark-ui-color-1)(0.5)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.