Skip to content

Commit

Permalink
fix: less variable conflict Tencent/tdesign-react#2822
Browse files Browse the repository at this point in the history
  • Loading branch information
NWYLZW committed Mar 29, 2024
1 parent becfba8 commit f965991
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 34 deletions.
10 changes: 5 additions & 5 deletions style/web/components/descriptions/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

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

@componentName: descriptions;

.@{prefix}-@{componentName} {
.@{prefix}-descriptions {
.reset;

@root: .@{prefix}-descriptions;

&__header {
color: @text-color-primary;
font: @font-title-medium;
Expand All @@ -27,7 +27,7 @@
.generate-padding(m, @descriptions-padding-m);
.generate-padding(s, @descriptions-padding-s);

& .@{prefix}-@{componentName}__label {
& @{root}__label {
color: @text-color-placeholder;
}

Expand All @@ -40,7 +40,7 @@
}
}

.@{prefix}-@{componentName}__label {
@{root}__label {
background-color: @bg-color-secondarycontainer;

&:hover {
Expand Down
40 changes: 20 additions & 20 deletions style/web/components/drawer/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

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

@componentName: drawer;

.@{prefix}-@{componentName} {
.@{prefix}-drawer {
.reset;

@root: .@{prefix}-drawer;

position: fixed;
z-index: 1500;
width: 100%;
Expand Down Expand Up @@ -85,7 +85,7 @@
position: relative;
}

.@{prefix}-@{componentName}__content-wrapper {
@{root}__content-wrapper {
position: absolute;
width: 100%;
height: 100%;
Expand Down Expand Up @@ -185,27 +185,27 @@
vertical-align: unset;
}
}
}

.@{prefix}-@{componentName}--open {
width: 100%;
height: 100%;
pointer-events: auto;

> .@{prefix}-@{componentName}__content-wrapper {
visibility: visible;
}

> .@{prefix}-@{componentName}__mask {
opacity: 1;
&--open {
width: 100%;
height: 100%;
pointer-events: auto;

> @{root}__content-wrapper {
visibility: visible;
}

> @{root}__mask {
opacity: 1;
width: 100%;
height: 100%;
}
}
}

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

[tabindex="-1"]:focus {
Expand Down
12 changes: 6 additions & 6 deletions style/web/components/guide/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

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

@componentName: guide;

.@{prefix}-@{componentName} {
.@{prefix}-guide {
.reset;

@root: .@{prefix}-guide;

&--lock {
overflow: hidden;
}
Expand Down Expand Up @@ -86,12 +86,12 @@
border: 1px solid @component-border;
}

.@{prefix}-@{componentName}__title {
@{root}__title {
font: @font-title-medium;
font-weight: 700;
}

.@{prefix}-@{componentName}__desc {
@{root}__desc {
margin-top: @guide-dialog-desc-margin-top;
font: @font-body-medium;
}
Expand Down Expand Up @@ -142,7 +142,7 @@
&--dialog {
margin-top: @spacer-3;

.@{prefix}-@{componentName} {
@{root} {
&__action {
display: flex;
justify-content: center;
Expand Down
4 changes: 1 addition & 3 deletions style/web/components/typography/_index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

@import "./_var.less";

@componentName: typography;

.@{prefix}-@{componentName} {
.@{prefix}-typography {
color: @typography-text-primary-color;
font: @font-body-medium;
margin: @comp-margin-m 0;
Expand Down

0 comments on commit f965991

Please sign in to comment.