Add more css

This commit is contained in:
Adrian Wozniak 2020-04-30 18:32:47 +02:00
parent 6cc90f07b4
commit 0c40dd1549

View File

@ -371,7 +371,7 @@ impl CssParser {
// "clip" => Property::Clip, // "clip" => Property::Clip,
// "clip-path" => Property::ClipPath, // "clip-path" => Property::ClipPath,
"color" => Property::Color(self.parse_full_token()?), "color" => Property::Color(self.parse_full_token()?),
// "column-count" => Property::ColumnCount, "column-count" => Property::ColumnCount(self.parse_full_token()?),
// "column-fill" => Property::ColumnFill, // "column-fill" => Property::ColumnFill,
// "column-gap" => Property::ColumnGap, // "column-gap" => Property::ColumnGap,
// "column-rule" => Property::ColumnRule, // "column-rule" => Property::ColumnRule,
@ -956,6 +956,27 @@ impl ParseToken<AllProperty> for CssParser {
} }
} }
#[derive(Debug, PartialEq)]
pub enum ColumnCountProperty {
Auto,
Number(u32),
}
impl Token for ColumnCountProperty {}
impl ParseToken<ColumnCountProperty> for CssParser {
fn parse_token(&mut self) -> ValueResult<ColumnCountProperty> {
let p = match self.expect_consume()?.as_str() {
"auto" => ColumnCountProperty::Auto,
s @ _ => ColumnCountProperty::Number(
s.parse::<u32>()
.map_err(|_| format!("invalid column count"))?,
),
};
Ok(PropertyValue::Other(p))
}
}
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
pub enum JustifyContentProperty { pub enum JustifyContentProperty {
FlexStart, FlexStart,
@ -1325,7 +1346,7 @@ pub enum Property {
Clip(String), Clip(String),
ClipPath(String), ClipPath(String),
Color(PropertyValue<ColorProperty>), Color(PropertyValue<ColorProperty>),
ColumnCount(String), ColumnCount(PropertyValue<ColumnCountProperty>),
ColumnFill(String), ColumnFill(String),
ColumnGap(String), ColumnGap(String),
ColumnRule(String), ColumnRule(String),