implement addition between num + bool

This commit is contained in:
ConnorSkees 2020-04-20 02:13:28 -04:00
parent 9103a1d0d8
commit 23390238b9
2 changed files with 14 additions and 0 deletions

View File

@ -60,6 +60,10 @@ impl Value {
format!("{}{}{}", num, unit, other.to_css_string(span)?), format!("{}{}{}", num, unit, other.to_css_string(span)?),
QuoteKind::None, QuoteKind::None,
), ),
Self::True | Self::False => Self::Ident(
format!("{}{}{}", num, unit, other.to_css_string(span)?),
QuoteKind::None,
),
_ => { _ => {
return Err(( return Err((
format!( format!(

View File

@ -253,3 +253,13 @@ test!(
"a {\n color: foo + #fff;\n}\n", "a {\n color: foo + #fff;\n}\n",
"a {\n color: foo#fff;\n}\n" "a {\n color: foo#fff;\n}\n"
); );
test!(
num_plus_true,
"a {\n color: 1 + true;\n}\n",
"a {\n color: 1true;\n}\n"
);
test!(
num_plus_false,
"a {\n color: 1 + false;\n}\n",
"a {\n color: 1false;\n}\n"
);