Skip to content

Commit 5d19340

Browse files
committed
feat: 支持解析 font-family
1 parent d78113a commit 5d19340

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

__test__/fixure/pesudo.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.act {
22
width:10px;
33
animation: anim 1s;
4+
font-family: 'Courier New', Courier, monospace;
45
}
56
@media (max-width:100px) {
67
.act {

src/parse_style_properties.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ pub fn parse_style_properties(properties: &Vec<(String, Property)>) -> Vec<Style
241241
value,
242242
))));
243243
}
244+
"fontFamily" => {
245+
final_properties.push(StyleValueType::Normal(Normal::new(
246+
CSSPropertyType::FontFamily,
247+
value
248+
.value_to_css_string(PrinterOptions::default())
249+
.unwrap(),
250+
)));
251+
}
244252
"lineHeight" => {
245253
final_properties.push(StyleValueType::LineHeight(LineHeight::from((
246254
id.to_string(),

0 commit comments

Comments
 (0)