Closed Scrum closed 4 years ago
@Scrum, is 0var(--test)
supposed to pass? Can you show an example? For example, with your change, I do not believe the following should pass:
/var\(--.*?\)/.test("avar(--test)") => true
is 0var(--test) supposed to pass?
yes, because if old browsers are not supported custome property
it is falsely transformed into 10px
eg
Can you show an example?
@for $step from 0 to 1 {
.offset-m-$(step) {
margin: $(step)var(--offset-ext);
}
}
after iteration we get
.offset-m-0 {
margin: 0var(--offset-ext);
}
.offset-m-1 {
margin: 1var(--offset-ext);
}
both values 0var(--offset-ext)
1var(--offset-ext)
in your pattern will be false
For example, with your change, I do not believe the following should pass:
proof from the console
I’m not sure that’s supposed to work at all.
I’m not sure that’s supposed to work at all.
in the case of a native example, this does not work (although I think it is wrong) but in your example the fallback will work.
In my example, the fallback will not be prepared. your regular expression does not fit.
Moreover, if I use the option preserve
then I don’t pull the fullback value
postcssCustomProperties({
preserve: false
});
I’m willing to reopen this, but I am closing it because the examples provided should not pass in valid CSS.
/(^|[^\w-])var\([\W\w]+\)/.test("0var(--test)") => false
/var\(--.*?\)/.test("0var(--test)") => true