implement number minus ident
This commit is contained in:
parent
90b940fd7d
commit
8a600a4f07
@ -120,6 +120,9 @@ impl Sub for Value {
|
|||||||
Self::List(..) => {
|
Self::List(..) => {
|
||||||
Value::Ident(format!("{}{}-{}", num, unit, other), QuoteKind::None)
|
Value::Ident(format!("{}{}-{}", num, unit, other), QuoteKind::None)
|
||||||
}
|
}
|
||||||
|
Self::Ident(..) => {
|
||||||
|
Value::Ident(format!("{}{}-{}", num, unit, other), QuoteKind::None)
|
||||||
|
}
|
||||||
_ => todo!(),
|
_ => todo!(),
|
||||||
},
|
},
|
||||||
Self::Color(c) => match other {
|
Self::Color(c) => match other {
|
||||||
|
@ -153,3 +153,18 @@ test!(
|
|||||||
"a {\n color: 'foo' - 1px;\n}\n",
|
"a {\n color: 'foo' - 1px;\n}\n",
|
||||||
"a {\n color: \"foo\"-1px;\n}\n"
|
"a {\n color: \"foo\"-1px;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
number_minus_unquoted_ident,
|
||||||
|
"a {\n color: 1 - foo;\n}\n",
|
||||||
|
"a {\n color: 1-foo;\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
number_minus_sglquoted_ident,
|
||||||
|
"a {\n color: 1 - 'foo';\n}\n",
|
||||||
|
"a {\n color: 1-\"foo\";\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
number_minus_dblquoted_ident,
|
||||||
|
"a {\n color: 1 - \"foo\";\n}\n",
|
||||||
|
"a {\n color: 1-\"foo\";\n}\n"
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user