fix: sass declaration deprecation error (#17549)

* fix: sass declaration deprecation error

* Add `&{}` for wrapping nested css blocks.

* fix: lint

* fix: update changes

* fix(style): switch/table-v2/upload compiling warning

* fix(style): update the rest warned sass files to avoid warning
This commit is contained in:
Jeremy 2024-07-20 11:03:12 +08:00 committed by GitHub
parent 8f9d512129
commit 1af2641228
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 76 additions and 63 deletions

View File

@ -5,9 +5,9 @@
@use 'mixins/utils' as *; @use 'mixins/utils' as *;
@include b(button-group) { @include b(button-group) {
@include utils-clearfix;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@include utils-clearfix;
& > .#{$namespace}-button { & > .#{$namespace}-button {
float: left; float: left;

View File

@ -72,12 +72,14 @@ $button-icon-span-gap: map.merge(
margin-left: 12px; margin-left: 12px;
} }
& {
@include button-size( @include button-size(
map.get($button-padding-vertical, 'default') - $button-border-width, map.get($button-padding-vertical, 'default') - $button-border-width,
map.get($button-padding-horizontal, 'default') - $button-border-width, map.get($button-padding-horizontal, 'default') - $button-border-width,
map.get($button-font-size, 'default'), map.get($button-font-size, 'default'),
map.get($button-border-radius, 'default') map.get($button-border-radius, 'default')
); );
}
&::-moz-focus-inner { &::-moz-focus-inner {
border: 0; border: 0;
@ -284,12 +286,14 @@ $button-icon-span-gap: map.merge(
} }
} }
& {
@include button-size( @include button-size(
map.get($button-padding-vertical, $size) - $button-border-width, map.get($button-padding-vertical, $size) - $button-border-width,
map.get($button-padding-horizontal, $size) - $button-border-width, map.get($button-padding-horizontal, $size) - $button-border-width,
map.get($button-font-size, $size), map.get($button-font-size, $size),
map.get($button-border-radius, $size) map.get($button-border-radius, $size)
); );
}
@include when(circle) { @include when(circle) {
width: getCssVar('button', 'size'); width: getCssVar('button', 'size');

View File

@ -15,11 +15,11 @@
@for $i from 0 through 24 { @for $i from 0 through 24 {
.#{$namespace}-col-#{$i} { .#{$namespace}-col-#{$i} {
display: if($i == 0, none, block); display: if($i == 0, none, block);
max-width: (math.div(1, 24) * $i * 100) * 1%;
flex: 0 0 (math.div(1, 24) * $i * 100) * 1%;
@include when(guttered) { @include when(guttered) {
display: if($i == 0, none, block); display: if($i == 0, none, block);
} }
max-width: (math.div(1, 24) * $i * 100) * 1%;
flex: 0 0 (math.div(1, 24) * $i * 100) * 1%;
} }
.#{$namespace}-col-offset-#{$i} { .#{$namespace}-col-offset-#{$i} {

View File

@ -19,13 +19,13 @@
&__inner { &__inner {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: textfield; -moz-appearance: textfield;
text-align: center;
line-height: 1;
&::-webkit-inner-spin-button, &::-webkit-inner-spin-button,
&::-webkit-outer-spin-button { &::-webkit-outer-spin-button {
margin: 0; margin: 0;
-webkit-appearance: none; -webkit-appearance: none;
} }
text-align: center;
line-height: 1;
} }
} }

View File

@ -60,7 +60,9 @@
box-sizing: border-box; box-sizing: border-box;
@include m(vertical) { @include m(vertical) {
&:not(.#{$namespace}-menu--collapse):not(.#{$namespace}-menu--popup-container) { &:not(.#{$namespace}-menu--collapse):not(
.#{$namespace}-menu--popup-container
) {
& .#{$namespace}-menu-item, & .#{$namespace}-menu-item,
& .#{$namespace}-sub-menu__title, & .#{$namespace}-sub-menu__title,
& .#{$namespace}-menu-item-group__title { & .#{$namespace}-menu-item-group__title {
@ -80,16 +82,15 @@
} }
@include m(horizontal) { @include m(horizontal) {
// reset menu-item popup height
&.#{$namespace}-menu--popup-container {
height: unset;
}
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
border-right: none; border-right: none;
height: getCssVar('menu-horizontal-height'); height: getCssVar('menu-horizontal-height');
// reset menu-item popup height
&.#{$namespace}-menu--popup-container {
height: unset;
}
&.#{$namespace}-menu { &.#{$namespace}-menu {
border-bottom: solid 1px getCssVar('menu-border-color'); border-bottom: solid 1px getCssVar('menu-border-color');

View File

@ -8,11 +8,11 @@
@for $i from 0 through 24 { @for $i from 0 through 24 {
.#{$namespace}-col-#{$size}-#{$i} { .#{$namespace}-col-#{$size}-#{$i} {
display: if($i == 0, none, block); display: if($i == 0, none, block);
max-width: (math.div(1, 24) * $i * 100) * 1%;
flex: 0 0 (math.div(1, 24) * $i * 100) * 1%;
@include when(guttered) { @include when(guttered) {
display: if($i == 0, none, block); display: if($i == 0, none, block);
} }
max-width: (math.div(1, 24) * $i * 100) * 1%;
flex: 0 0 (math.div(1, 24) * $i * 100) * 1%;
} }
.#{$namespace}-col-#{$size}-offset-#{$i} { .#{$namespace}-col-#{$size}-offset-#{$i} {

View File

@ -2,9 +2,6 @@
@use 'common/var' as *; @use 'common/var' as *;
@include b(overlay) { @include b(overlay) {
#{& + '-root'} {
height: 0;
}
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
@ -14,4 +11,7 @@
height: 100%; height: 100%;
background-color: getCssVar('overlay-color', 'lighter'); background-color: getCssVar('overlay-color', 'lighter');
overflow: auto; overflow: auto;
#{& + '-root'} {
height: 0;
}
} }

View File

@ -171,6 +171,10 @@ $switch-content-padding: map.merge(
justify-content: center; justify-content: center;
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
padding: 0 #{map.get($switch-content-padding, 'default')} 0 calc(#{map.get(
$switch-button-size,
'default'
)} + 2px);
.is-icon, .is-icon,
.is-text { .is-text {
@ -179,10 +183,6 @@ $switch-content-padding: map.merge(
user-select: none; user-select: none;
@include utils-ellipsis; @include utils-ellipsis;
} }
padding: 0 #{map.get($switch-content-padding, 'default')} 0 calc(#{map.get(
$switch-button-size,
'default'
)} + 2px);
} }
.#{$namespace}-switch__action { .#{$namespace}-switch__action {

View File

@ -20,6 +20,7 @@
justify-content: center; justify-content: center;
text-align: center; text-align: center;
} }
@include when('align-right') { @include when('align-right') {
justify-content: flex-end; justify-content: flex-end;
text-align: right; text-align: right;
@ -39,6 +40,7 @@
.#{$namespace}-virtual-scrollbar { .#{$namespace}-virtual-scrollbar {
opacity: 0; opacity: 0;
} }
.#{$namespace}-vl__vertical, .#{$namespace}-vl__vertical,
.#{$namespace}-vl__horizontal { .#{$namespace}-vl__horizontal {
z-index: -1; z-index: -1;
@ -51,6 +53,7 @@
@include b('table-v2') { @include b('table-v2') {
font-size: 14px; font-size: 14px;
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -136,15 +139,15 @@
border-bottom: getCssVar('table', 'border'); border-bottom: getCssVar('table', 'border');
@include e('header-cell') { @include e('header-cell') {
@include center-flex;
@include cell-padding;
@include cell-alignment;
height: 100%; height: 100%;
user-select: none; user-select: none;
overflow: hidden; overflow: hidden;
background-color: getCssVar('table-header', 'bg-color'); background-color: getCssVar('table-header', 'bg-color');
color: getCssVar('table-header', 'text-color'); color: getCssVar('table-header', 'text-color');
font-weight: bold; font-weight: bold;
@include center-flex;
@include cell-padding;
@include cell-alignment;
@include when(sortable) { @include when(sortable) {
cursor: pointer; cursor: pointer;
@ -220,6 +223,7 @@
@include e('row') { @include e('row') {
overflow: hidden; overflow: hidden;
align-items: stretch; align-items: stretch;
@include e('row-cell') { @include e('row-cell') {
overflow-wrap: break-word; overflow-wrap: break-word;
} }

View File

@ -64,32 +64,6 @@ $tag-icon-span-gap: map.merge(
} }
@include b(tag) { @include b(tag) {
@include genTheme('light-9', 'light-8', '');
@each $type in $types {
&.#{bem('tag', '', $type)} {
@include css-var-from-global(('tag', 'text-color'), ('color', $type));
}
}
@include when(hit) {
border-color: getCssVar('color', 'primary');
}
@include when(round) {
border-radius: getCssVar('tag', 'border-radius-rounded');
}
.#{$namespace}-tag__close {
flex-shrink: 0;
color: getCssVar('tag', 'text-color');
&:hover {
color: getCssVar('color-white');
background-color: getCssVar('tag-hover-color');
}
}
background-color: getCssVar('tag-bg-color'); background-color: getCssVar('tag-bg-color');
border-color: getCssVar('tag-border-color'); border-color: getCssVar('tag-border-color');
color: getCssVar('tag-text-color'); color: getCssVar('tag-text-color');
@ -110,6 +84,31 @@ $tag-icon-span-gap: map.merge(
white-space: nowrap; white-space: nowrap;
@include set-css-var-value('icon-size', 14px); @include set-css-var-value('icon-size', 14px);
@include genTheme('light-9', 'light-8', '');
@include when(hit) {
border-color: getCssVar('color', 'primary');
}
@include when(round) {
border-radius: getCssVar('tag', 'border-radius-rounded');
}
.#{$namespace}-tag__close {
flex-shrink: 0;
color: getCssVar('tag', 'text-color');
&:hover {
color: getCssVar('color-white');
background-color: getCssVar('tag-hover-color');
}
}
@each $type in $types {
&.#{bem('tag', '', $type)} {
@include css-var-from-global(('tag', 'text-color'), ('color', $type));
}
}
$svg-margin-size: 1px; $svg-margin-size: 1px;
@ -127,8 +126,8 @@ $tag-icon-span-gap: map.merge(
} }
@include m(dark) { @include m(dark) {
@include genTheme('', '', 'light-3');
@include css-var-from-global(('tag', 'text-color'), ('color', 'white')); @include css-var-from-global(('tag', 'text-color'), ('color', 'white'));
@include genTheme('', '', 'light-3');
@each $type in $types { @each $type in $types {
&.#{bem('tag', '', $type)} { &.#{bem('tag', '', $type)} {
@ -138,8 +137,8 @@ $tag-icon-span-gap: map.merge(
} }
@include m(plain) { @include m(plain) {
@include genTheme(false, 'light-5', '');
@include css-var-from-global(('tag', 'bg-color'), ('fill-color', 'blank')); @include css-var-from-global(('tag', 'bg-color'), ('fill-color', 'blank'));
@include genTheme(false, 'light-5', '');
} }
&.is-closable { &.is-closable {

View File

@ -28,6 +28,7 @@
cursor: pointer; cursor: pointer;
outline: none; outline: none;
@include e(input) { @include e(input) {
display: none; display: none;
} }
@ -144,6 +145,7 @@
padding: 0; padding: 0;
list-style: none; list-style: none;
position: relative; position: relative;
@include e(item) { @include e(item) {
transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1); transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
font-size: 14px; font-size: 14px;
@ -246,6 +248,7 @@
&:active { &:active {
/* click时 */ /* click时 */
outline-width: 0; outline-width: 0;
.#{bem('icon', '', 'close-tip')} { .#{bem('icon', '', 'close-tip')} {
display: none; display: none;
} }
@ -340,6 +343,7 @@
.#{bem('icon', '', 'close')} { .#{bem('icon', '', 'close')} {
display: none; display: none;
} }
&:hover { &:hover {
.#{bem('upload-list', 'item-status-label')} { .#{bem('upload-list', 'item-status-label')} {
opacity: 0; opacity: 0;
@ -404,6 +408,7 @@
&:hover { &:hover {
opacity: 1; opacity: 1;
span { span {
display: inline-flex; display: inline-flex;
} }