Comments (9)
Why not.
But what about handling !important
when parsing custom prop ? I'm not sure we are currently supporting it.
from postcss-custom-properties.
How is !important
parsing related?
from postcss-custom-properties.
It was just an idea to make user able to get javascript defined as a fallback OR more important.
variables: {
"--test-one": "js-one !important",
"--test-two": "js-two !important",
"--test-three": "js-three"
}
:root {
--test-one: local;
--test-two: local !important;
}
div {
color: var(--test-one);
color: var(--test-two);
color: var(--test-three);
}
Could give
div {
color: js-one;
color: local;
color: js-three;
}
Take a look to this example using firefox http://jsbin.com/qefano/1/edit You should inderstand what I mean.
from postcss-custom-properties.
This one is even better http://jsbin.com/qefano/2/edit
from postcss-custom-properties.
If that is spec-ed behaviour, then we should definitely add support for it to the lib. But I think JS-defined is a different issue and should act as if you're appending :root
declarations to the end of the CSS document. That way you could also override CSS-defined !important
values :)
from postcss-custom-properties.
FYI I've opened a new issue for the !important thing #12
from postcss-custom-properties.
Would it be ok to be collab on these repos you ported? I'm moving our stuff over to postcss.
from postcss-custom-properties.
Added as owner for postcss ;)
from postcss-custom-properties.
Thanks Maxime :)
from postcss-custom-properties.
Related Issues (20)
- Doesn't convert variable with postcss mixin
- Non-passive change for ImportFrom Priority HOT 2
- How to watch file defined in importFrom in webpack? HOT 2
- Nested custom properties with preserve false does not work correctly HOT 1
- High severity vulnerabilities in dependencies HOT 2
- Process CSS synchronously? Plus add example to DOC.
- Emojis in property name are not working âšī¸ HOT 3
- importFrom CSS string HOT 1
- Variables starting with '-' cannot be recognized HOT 1
- Webpack example seems to be incorrect HOT 2
- Error: PostCSS plugin postcss-custom-properties requires PostCSS 8. HOT 1
- Error: Error: PostCSS plugin postcss-custom-properties requires PostCSS 8. HOT 1
- Inline urls confuse the parser HOT 1
- variable '--van-gray-6' is undefined and used without a fallback
- variable '--van-gray-6' is undefined and used without a fallback HOT 1
- `importFrom` should support ESM HOT 2
- v12.0.0's env = development and preserve: false is not working. HOT 5
- CSS variables with url() lead to an `Cannot read property 'value' of undefined` HOT 2
- Import from .postcss files HOT 1
- Unknown word error when attempting to parse valid CSS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postcss-custom-properties.