Skip to content

Commit d8954ae

Browse files
committed
feat: 优化样式处理逻辑
1 parent 82aa6f5 commit d8954ae

File tree

6 files changed

+194
-221
lines changed

6 files changed

+194
-221
lines changed

__test__/fixure/mod.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import './Mod.scss'
33

44
function Cc() {
55
return (
6-
<div className='cc'>
6+
<div className={boxClass.join(' ')} style={bannerStyle}>
77
<span className='line1 txt'>成员123: 4000+</span>
88
<div className='cnt_row4'>
99
<img className='icon2' src='//img11.360buyimg.com/img/jfs/t1/175578/35/40256/1981/64f58062Fddaf1a21/f1111d9988a65ccc.png'></img>

__test__/index.spec.mjs.md

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,64 @@ Generated by [AVA](https://avajs.dev).
1313
import { calcDynamicStyle as calcDynamicStyle } from "@tarojs/runtime";␊
1414
var __inner_style__ = {␊
1515
"cnt_col": {␊
16+
width: "145px",␊
1617
display: "flex",␊
1718
flexDirection: "column",␊
19+
height: "50px",␊
1820
alignItems: "flex-start",␊
1921
justifyContent: "center",␊
20-
gap: "8px",␊
21-
width: "145px",␊
22-
height: "50px"␊
22+
gap: "8px"␊
2323
},␊
2424
"cnt_row": {␊
25-
width: "176px",␊
26-
height: "24px",␊
25+
display: "flex",␊
26+
gap: "4px",␊
2727
borderRadius: "100px",␊
28+
paddingTop: "8px",␊
29+
paddingBottom: "8px",␊
30+
paddingRight: "8px",␊
31+
height: "24px",␊
2832
backgroundColor: "rgba(0, 0, 0, .7)",␊
29-
display: "flex",␊
30-
alignItems: "center",␊
3133
justifyContent: "center",␊
3234
flexShrink: "0px",␊
33-
gap: "4px",␊
35+
alignItems: "center",␊
3436
paddingLeft: "4px",␊
35-
paddingRight: "8px",␊
36-
paddingTop: "8px",␊
37-
paddingBottom: "8px"␊
37+
width: "176px"␊
3838
},␊
3939
"cnt_row1": {␊
40+
position: "relative",␊
41+
gap: "10px",␊
42+
justifyContent: "flex-start",␊
4043
display: "flex",␊
4144
alignItems: "center",␊
42-
justifyContent: "flex-start",␊
43-
gap: "10px",␊
44-
position: "relative",␊
4545
width: "311px",␊
4646
height: "50px"␊
4747
},␊
4848
"cnt_row2": {␊
49-
borderWidth: "1px",␊
50-
borderStyle: "solid",␊
51-
borderColor: "#999",␊
52-
borderRadius: "12px",␊
53-
display: "flex",␊
5449
alignItems: "flex-start",␊
55-
justifyContent: "space-between",␊
56-
flexShrink: "0px",␊
57-
gap: "-94px",␊
50+
borderWidth: "1px",␊
51+
paddingRight: "8px",␊
5852
position: "absolute",␊
59-
top: "3px",␊
6053
left: "201px",␊
61-
width: "110px",␊
62-
height: "23px",␊
54+
borderRadius: "12px",␊
55+
gap: "-94px",␊
56+
flexShrink: "0px",␊
6357
paddingLeft: "8px",␊
64-
paddingRight: "8px",␊
65-
paddingTop: "4px",␊
6658
paddingBottom: "4px",␊
67-
zIndex: "12"␊
59+
justifyContent: "space-between",␊
60+
paddingTop: "4px",␊
61+
borderColor: "#999",␊
62+
zIndex: "12",␊
63+
top: "3px",␊
64+
display: "flex",␊
65+
borderStyle: "solid",␊
66+
width: "110px",␊
67+
height: "23px"␊
6868
},␊
6969
"cnt_row3": {␊
70-
display: "flex",␊
71-
alignItems: "center",␊
7270
justifyContent: "space-between",␊
7371
gap: "-311px",␊
72+
display: "flex",␊
73+
alignItems: "center",␊
7474
width: "311px",␊
7575
height: "44px"␊
7676
},␊
@@ -91,71 +91,71 @@ Generated by [AVA](https://avajs.dev).
9191
height: "10px"␊
9292
},␊
9393
"instruction": {␊
94-
color: "#fff",␊
9594
fontSize: "12px",␊
9695
lineHeight: "1",␊
97-
flexShrink: "0px",␊
98-
display: "inline-flex"␊
96+
display: "inline-flex",␊
97+
color: "#fff",␊
98+
flexShrink: "0px"␊
9999
},␊
100100
"instruction1": {␊
101-
color: "#000",␊
102101
fontSize: "16px",␊
103-
lineHeight: "1",␊
104-
flexShrink: "0px",␊
105102
width: "116px",␊
106-
display: "inline-flex"␊
103+
flexShrink: "0px",␊
104+
display: "inline-flex",␊
105+
lineHeight: "1",␊
106+
color: "#000"␊
107107
},␊
108108
"instruction2": {␊
109-
color: "#999",␊
110-
fontSize: "11px",␊
111-
lineHeight: "1.36",␊
112109
textAlign: "center",␊
113110
flexShrink: "0px",␊
114-
overflow: "hidden"␊
111+
color: "#999",␊
112+
lineHeight: "1.36",␊
113+
overflow: "hidden",␊
114+
fontSize: "11px"␊
115115
},␊
116116
"line1": {␊
117-
textOverflow: "ellipsis",␊
117+
overflow: "hidden",␊
118118
whiteSpace: "nowrap",␊
119-
overflow: "hidden"␊
119+
textOverflow: "ellipsis"␊
120120
},␊
121121
"mod": {␊
122-
backgroundColor: "#fff6f0",␊
122+
gap: "8px",␊
123123
borderRadius: "8px",␊
124124
width: "343px",␊
125-
height: "166px",␊
126-
fontFamily: "Source Han Sans CN",␊
127-
fontWeight: "500",␊
128-
display: "flex",␊
129125
flexDirection: "column",␊
130-
alignItems: "flex-start",␊
131-
justifyContent: "center",␊
126+
paddingBottom: "29px",␊
127+
backgroundColor: "#fff6f0",␊
132128
flexShrink: "0px",␊
133-
gap: "8px",␊
134-
paddingLeft: "16px",␊
135-
paddingRight: "16px",␊
129+
justifyContent: "center",␊
136130
paddingTop: "29px",␊
137-
paddingBottom: "29px"␊
131+
fontWeight: "500",␊
132+
paddingRight: "16px",␊
133+
fontFamily: "Source Han Sans CN",␊
134+
paddingLeft: "16px",␊
135+
height: "166px",␊
136+
display: "flex",␊
137+
alignItems: "flex-start"␊
138138
},␊
139139
"txt": {␊
140+
display: "inline-flex",␊
140141
color: "#999",␊
141-
fontSize: "12px",␊
142-
lineHeight: "1",␊
143142
flexShrink: "0px",␊
144-
display: "inline-flex"␊
143+
fontSize: "12px",␊
144+
lineHeight: "1"␊
145145
},␊
146146
"txt1": {␊
147147
color: "#222",␊
148-
fontSize: "11px",␊
149148
lineHeight: "1.36",␊
150-
textAlign: "center",␊
151-
flexShrink: "0px"␊
149+
flexShrink: "0px",␊
150+
fontSize: "11px",␊
151+
textAlign: "center"␊
152152
},␊
153153
"txt2": {␊
154-
color: "#999",␊
154+
width: "290px",␊
155155
fontSize: "12px",␊
156156
lineHeight: "1.83",␊
157157
flexShrink: "0px",␊
158-
width: "290px",␊
158+
color: "#999",␊
159159
display: "inline-flex"␊
160160
}␊
161161
};␊
@@ -214,20 +214,20 @@ Generated by [AVA](https://avajs.dev).
214214
}␊
215215
render() {␊
216216
return <div className='mod' style={{␊
217-
paddingBottom: "29px",␊
218-
paddingTop: "29px",␊
219-
paddingRight: "16px",␊
220-
paddingLeft: "16px",␊
221-
gap: "8px",␊
222-
flexShrink: "0px",␊
223-
justifyContent: "center",␊
224217
alignItems: "flex-start",␊
225-
flexDirection: "column",␊
226218
display: "flex",␊
227-
fontWeight: "500",␊
219+
paddingLeft: "16px",␊
228220
fontFamily: "Source Han Sans CN",␊
229-
borderRadius: "8px",␊
221+
paddingRight: "16px",␊
222+
fontWeight: "500",␊
223+
paddingTop: "29px",␊
224+
justifyContent: "center",␊
225+
flexShrink: "0px",␊
230226
backgroundColor: "#fff6f0",␊
227+
paddingBottom: "29px",␊
228+
flexDirection: "column",␊
229+
borderRadius: "8px",␊
230+
gap: "8px",␊
231231
width: '500px',␊
232232
height: 800␊
233233
}}>␊

__test__/index.spec.mjs.snap

36 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)