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

Implement CSS3 Calc #7185

Closed
wants to merge 20 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 Sep 2, 2015
commit 7a9d3252651454d7178855b6488c45c2f14589b7
@@ -628,7 +628,7 @@ pub mod specified {
}

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