Skip to content

Commit ff66074

Browse files
authored
fix: less variable conflict (#1757)
* fix: less variable conflict Tencent/tdesign-react#2822 * fix: stylelint CssSyntaxError stylelint/stylelint#7584
1 parent becfba8 commit ff66074

File tree

4 files changed

+32
-34
lines changed

4 files changed

+32
-34
lines changed

style/web/components/descriptions/_index.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
@import "../../mixins/_reset.less";
88

9-
@componentName: descriptions;
10-
11-
.@{prefix}-@{componentName} {
9+
.@{prefix}-descriptions {
1210
.reset;
1311

12+
@root: ~".@{prefix}-descriptions";
13+
1414
&__header {
1515
color: @text-color-primary;
1616
font: @font-title-medium;
@@ -27,7 +27,7 @@
2727
.generate-padding(m, @descriptions-padding-m);
2828
.generate-padding(s, @descriptions-padding-s);
2929

30-
& .@{prefix}-@{componentName}__label {
30+
& @{root}__label {
3131
color: @text-color-placeholder;
3232
}
3333

@@ -40,7 +40,7 @@
4040
}
4141
}
4242

43-
.@{prefix}-@{componentName}__label {
43+
@{root}__label {
4444
background-color: @bg-color-secondarycontainer;
4545

4646
&:hover {

style/web/components/drawer/_index.less

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
@import "../../mixins/_reset.less";
1111

12-
@componentName: drawer;
13-
14-
.@{prefix}-@{componentName} {
12+
.@{prefix}-drawer {
1513
.reset;
1614

15+
@root: ~".@{prefix}-drawer";
16+
1717
position: fixed;
1818
z-index: 1500;
1919
width: 100%;
@@ -85,7 +85,7 @@
8585
position: relative;
8686
}
8787

88-
.@{prefix}-@{componentName}__content-wrapper {
88+
@{root}__content-wrapper {
8989
position: absolute;
9090
width: 100%;
9191
height: 100%;
@@ -185,27 +185,27 @@
185185
vertical-align: unset;
186186
}
187187
}
188-
}
189-
190-
.@{prefix}-@{componentName}--open {
191-
width: 100%;
192-
height: 100%;
193-
pointer-events: auto;
194-
195-
> .@{prefix}-@{componentName}__content-wrapper {
196-
visibility: visible;
197-
}
198188

199-
> .@{prefix}-@{componentName}__mask {
200-
opacity: 1;
189+
&--open {
201190
width: 100%;
202191
height: 100%;
192+
pointer-events: auto;
193+
194+
> @{root}__content-wrapper {
195+
visibility: visible;
196+
}
197+
198+
> @{root}__mask {
199+
opacity: 1;
200+
width: 100%;
201+
height: 100%;
202+
}
203203
}
204-
}
205204

206-
// 需要在 t-drawer--open 后面,优先级才比 open 高
207-
.@{prefix}-@{componentName}--without-mask {
208-
pointer-events: none;
205+
// 需要在 t-drawer--open 后面,优先级才比 open 高
206+
&--without-mask {
207+
pointer-events: none;
208+
}
209209
}
210210

211211
[tabindex="-1"]:focus {

style/web/components/guide/_index.less

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
@import "../../mixins/_reset.less";
88

9-
@componentName: guide;
10-
11-
.@{prefix}-@{componentName} {
9+
.@{prefix}-guide {
1210
.reset;
1311

12+
@root: ~".@{prefix}-guide";
13+
1414
&--lock {
1515
overflow: hidden;
1616
}
@@ -86,12 +86,12 @@
8686
border: 1px solid @component-border;
8787
}
8888

89-
.@{prefix}-@{componentName}__title {
89+
@{root}__title {
9090
font: @font-title-medium;
9191
font-weight: 700;
9292
}
9393

94-
.@{prefix}-@{componentName}__desc {
94+
@{root}__desc {
9595
margin-top: @guide-dialog-desc-margin-top;
9696
font: @font-body-medium;
9797
}
@@ -142,7 +142,7 @@
142142
&--dialog {
143143
margin-top: @spacer-3;
144144

145-
.@{prefix}-@{componentName} {
145+
@{root} {
146146
&__action {
147147
display: flex;
148148
justify-content: center;

style/web/components/typography/_index.less

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
@import "./_var.less";
44

5-
@componentName: typography;
6-
7-
.@{prefix}-@{componentName} {
5+
.@{prefix}-typography {
86
color: @typography-text-primary-color;
97
font: @font-body-medium;
108
margin: @comp-margin-m 0;

0 commit comments

Comments
 (0)