Skip to content

Commit 13c33bf

Browse files
committed
feat: 增加滤镜解析
1 parent d5e5401 commit 13c33bf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/parse_style_properties.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,13 @@ pub fn parse_style_properties(properties: &Vec<(String, Property)>) -> DeclsAndV
550550
value,
551551
))));
552552
}
553+
"filter" => {
554+
// 吐出字符串
555+
final_properties.push(StyleValueType::Expr(Expr::new(
556+
CSSPropertyType::Filter,
557+
generate_expr_lit_str!(value.value_to_css_string(PrinterOptions::default()).unwrap()),
558+
)));
559+
}
553560
_ => {
554561
// position、zIndex等... 会自动处理 单位、数字等相关信息
555562
// final_properties.push(StyleValueType::Normal(Normal::new(id.to_string(), value.value_to_css_string(PrinterOptions::default()).unwrap())));

src/style_propetries/style_property_type.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ pub enum CSSPropertyType {
112112
Gap = 107, // 复合属性
113113
AnimationDirection = 108,
114114
AnimationPlayState = 109,
115+
Animation = 110,
116+
Filter = 111,
115117
// ...
116118
All = 99999, // used for transition-property
117119
}
@@ -226,6 +228,7 @@ pub fn string_to_css_property_type(property: &str) -> CSSPropertyType {
226228
"border" => CSSPropertyType::Border,
227229
"gap" => CSSPropertyType::Gap,
228230
"borderStyle" => CSSPropertyType::BorderStyle,
231+
"filter" => CSSPropertyType::Filter,
229232
// E 复合属性,仅用作css变量的解析 ====
230233
_ => CSSPropertyType::Invalid,
231234
}

0 commit comments

Comments
 (0)