Skip to content

Commit 2dba431

Browse files
committed
feat: 支持border-left/right/bottom/top 4个方向的变量处理
1 parent 9c51163 commit 2dba431

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

__test__/fixure/pesudo.scss

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
.hello {
2-
height: 100px;
3-
width: 50%;
4-
flex-direction: column;
5-
flex-grow: 1;
6-
color: #00f;
2+
border-left: 10px solid var(--aa-color);
73
}
8-
9-
.child {
10-
background-size: contain;
11-
background-image: linear-gradient(to bottom, #f00, #00f 10%, #0f0);
12-
}
13-
14-
@media screen and (max-width: 100px) {
15-
.hello {
16-
height: 200px;
17-
width: 100%;
18-
color: #f00;
19-
background-image: radial-gradient(circle, #f00, #00f 10%, #0f0);
20-
}
21-
}

__test__/fixure/style.bin

-1.18 KB
Binary file not shown.

src/style_propetries/style_property_type.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ pub enum CSSPropertyType {
114114
AnimationPlayState = 109,
115115
Animation = 110,
116116
Filter = 111,
117+
BorderTop = 112,
118+
BorderRight = 113,
119+
BorderBottom = 114,
120+
BorderLeft = 115,
117121
// ...
118122
All = 99999, // used for transition-property
119123
}
@@ -229,6 +233,10 @@ pub fn string_to_css_property_type(property: &str) -> CSSPropertyType {
229233
"gap" => CSSPropertyType::Gap,
230234
"borderStyle" => CSSPropertyType::BorderStyle,
231235
"filter" => CSSPropertyType::Filter,
236+
"borderTop" => CSSPropertyType::BorderTop,
237+
"borderRight" => CSSPropertyType::BorderRight,
238+
"borderBottom" => CSSPropertyType::BorderBottom,
239+
"borderLeft" => CSSPropertyType::BorderLeft,
232240
// E 复合属性,仅用作css变量的解析 ====
233241
_ => CSSPropertyType::Invalid,
234242
}

0 commit comments

Comments
 (0)