Skip to content

Commit dfeef03

Browse files
committed
fix: 暂时取消支持样式继承
1 parent f61304a commit dfeef03

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

__test__/index.spec.mjs.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,35 +87,35 @@ Generated by [AVA](https://avajs.dev).
8787
8888
<div className='cnt_col' style="display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;width:145px;height:50px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;flex-shrink:0px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;position:relative;">␊
8989
90-
<span className='line1 instruction1' style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;flex-shrink:0px;width:116px;display:inline-flex;background-color:#fff6f0;border-radius:8px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;position:relative;">巴拉巴拉小魔仙</span>␊
90+
<span className='line1 instruction1' style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#000;font-size:16px;line-height:1;flex-shrink:0px;width:116px;display:inline-flex;background-color:#fff6f0;border-radius:8px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;position:relative;">巴拉巴拉小魔仙</span>␊
9191
92-
<span className='line1 txt' style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#000;font-size:16px;line-height:1;flex-shrink:0px;display:inline-flex;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;position:relative;">成员: 4000+</span>␊
92+
<span className='line1 txt' style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#999;font-size:12px;line-height:1;flex-shrink:0px;display:inline-flex;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;position:relative;">成员: 4000+</span>␊
9393
9494
</div>␊
9595
96-
<div className='cnt_row2' style="border-width:1px;border-style:solid;border-color:#999;border-radius:12px;display:flex;align-items:flex-start;justify-content:space-between;flex-shrink:0px;gap:-94px;position:absolute;top:3px;left:201px;width:110px;height:23px;padding-left:8px;padding-right:8px;padding-top:4px;padding-bottom:4px;z-index:12;background-color:#fff6f0;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#999;font-size:12px;line-height:1;">␊
96+
<div className='cnt_row2' style="border-width:1px;border-style:solid;border-color:#999;border-radius:12px;display:flex;align-items:flex-start;justify-content:space-between;flex-shrink:0px;gap:-94px;position:absolute;top:3px;left:201px;width:110px;height:23px;padding-left:8px;padding-right:8px;padding-top:4px;padding-bottom:4px;z-index:12;background-color:#fff6f0;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;">␊
9797
9898
{this.getDom()}␊
9999
100-
<img className='icon1' src='//img11.360buyimg.com/img/jfs/t1/175578/35/40256/1981/64f58062Fddaf1a21/f1111d9988a65ccc.png' style="width:15px;height:15px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex-shrink:0px;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#999;font-size:12px;line-height:1;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;"></img>␊
100+
<img className='icon1' src='//img11.360buyimg.com/img/jfs/t1/175578/35/40256/1981/64f58062Fddaf1a21/f1111d9988a65ccc.png' style="width:15px;height:15px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex-shrink:0px;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;"></img>␊
101101
102-
<span className='instruction2' style="color:#999;font-size:12px;line-height:1;text-align:center;flex-shrink:0px;overflow:hidden;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;">slslsl-jsj</span>␊
102+
<span className='instruction2' style="color:#999;font-size:11px;line-height:1.36;text-align:center;flex-shrink:0px;overflow:hidden;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;">slslsl-jsj</span>␊
103103
104-
<span className='txt1' style="color:#999;font-size:11px;line-height:1.36;text-align:center;flex-shrink:0px;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;">复制</span>␊
104+
<span className='txt1' style="color:#222;font-size:11px;line-height:1.36;text-align:center;flex-shrink:0px;background-color:#fff6f0;border-radius:8px;width:343px;height:166px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;">复制</span>␊
105105
106106
</div>␊
107107
108108
</div>␊
109109
110-
<div className='cnt_row3' style="display:flex;align-items:center;justify-content:space-between;gap:-311px;width:311px;height:44px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;flex-shrink:0px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#222;font-size:11px;line-height:1.36;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;">␊
110+
<div className='cnt_row3' style="display:flex;align-items:center;justify-content:space-between;gap:-311px;width:311px;height:44px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;flex-shrink:0px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;">␊
111111
112-
<span className='line2 txt2' style="color:#222;font-size:11px;line-height:1.36;flex-shrink:0px;width:290px;display:inline-flex;background-color:#fff6f0;border-radius:8px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;">␊
112+
<span className='line2 txt2' style="color:#999;font-size:12px;line-height:1.83;flex-shrink:0px;width:290px;display:inline-flex;background-color:#fff6f0;border-radius:8px;height:166px;font-family:Source Han Sans CN;font-weight:500;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;">␊
113113
114114
团长介绍:售前售后进群售前售后进群售前售后进群售前售后进群VXklsidohh...␊
115115
116116
</span>␊
117117
118-
<img className='img1' src='//img14.360buyimg.com/img/jfs/t1/206378/24/25778/195/64eca527F378f17a2/c1623681708609fd.png' style="width:6px;height:10px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex-shrink:0px;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#999;font-size:12px;line-height:1.83;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;"></img>␊
118+
<img className='img1' src='//img14.360buyimg.com/img/jfs/t1/206378/24/25778/195/64eca527F378f17a2/c1623681708609fd.png' style="width:6px;height:10px;background-color:#fff6f0;border-radius:8px;font-family:Source Han Sans CN;font-weight:500;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;flex-shrink:0px;gap:8px;padding-left:16px;padding-right:16px;padding-top:29px;padding-bottom:29px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#fff;font-size:12px;line-height:1;position:relative;border-width:1px;border-style:solid;border-color:#999;top:3px;left:201px;z-index:12;text-align:center;"></img>␊
119119
120120
</div>␊
121121

__test__/index.spec.mjs.snap

-12 Bytes
Binary file not shown.

src/utils.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use lightningcss::properties::PropertyId;
55
use once_cell::sync::Lazy;
66
use swc_ecma_ast::{JSXMemberExpr, JSXObject};
77

8-
static INHERITABLE_STYLES: Lazy<HashSet<PropertyId<'static>>> = Lazy::new(|| {
8+
static _INHERITABLE_STYLES: Lazy<HashSet<PropertyId<'static>>> = Lazy::new(|| {
99
let mut styles = HashSet::new();
1010
styles.insert(PropertyId::from("color"));
1111
styles.insert(PropertyId::from("font-size"));
@@ -90,8 +90,9 @@ pub fn create_qualname(str: &str) -> QualName {
9090
QualName::new(None, ns!(), LocalName::from(str))
9191
}
9292

93-
pub fn is_style_inheritable(style: PropertyId<'_>) -> bool {
94-
INHERITABLE_STYLES.contains(&style)
93+
pub fn is_style_inheritable(_style: PropertyId<'_>) -> bool {
94+
// INHERITABLE_STYLES.contains(&style)
95+
false
9596
}
9697

9798
pub fn is_starts_with_uppercase(str: &str) -> bool {

0 commit comments

Comments
 (0)