Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[not ready for review yet] Allow calc expressions when parsing numbers #7308

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Clean up serialization code a little

  • Loading branch information
dzbarsky committed Aug 21, 2015
commit 756fee45e8389cdfb62903fc36ab8738ee04060f
@@ -623,7 +623,7 @@ pub mod specified {
}

macro_rules! serialize {
( $( [$val:ident; $name:expr] ),* ) => {
( $( $val:ident ),* ) => {
{
let mut first_value = true;
$(
@@ -633,7 +633,7 @@ pub mod specified {
} else {
first_value = false;
}
try!(write!(dest, "{:?}{}", val, $name));
try!(val.to_css(dest));
}
)*
}
@@ -647,16 +647,7 @@ pub mod specified {
try!(write!(dest, "calc("));
}

serialize!(
[em; "em"],
[ex; "ex"],
[absolute; "px"],
[rem; "rem"],
[vh; "vh"],
[vmax; "vmax"],
[vmin; "vmin"],
[vw; "vw"],
[percentage; "%"]);
serialize!(em, ex, absolute, rem, vh, vmax, vmin, vw, percentage);

if count > 1 {
try!(write!(dest, ")"));
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.