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

Introduce #[css(if_empty = "…", iterable)] #20230

Merged
merged 2 commits into from Mar 7, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Derive ToCss for TemplateAreas

  • Loading branch information
nox committed Mar 7, 2018
commit 92f116a95ca74fa4215a7deff5356fb9bd78c846
@@ -509,14 +509,17 @@ impl From<GridAutoFlow> for u8 {
}

#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, ToCss)]
/// https://drafts.csswg.org/css-grid/#named-grid-area
pub struct TemplateAreas {
/// `named area` containing for each template area
#[css(skip)]
pub areas: Box<[NamedArea]>,
/// The original CSS string value of each template area
#[css(iterable)]
pub strings: Box<[Box<str>]>,
/// The number of columns of the grid.
#[css(skip)]
pub width: u32,
}

@@ -596,21 +599,6 @@ impl TemplateAreas {
}
}

impl ToCss for TemplateAreas {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
where
W: Write,
{
for (i, string) in self.strings.iter().enumerate() {
if i != 0 {
dest.write_str(" ")?;
}
string.to_css(dest)?;
}
Ok(())
}
}

impl Parse for TemplateAreas {
fn parse<'i, 't>(
_context: &ParserContext,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.