From 574bf98d435535476840ebd265f4fa41e52851ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=8F=AA=E5=89=8D=E7=AB=AF=E6=B1=AA?= <985313519@qq.com> Date: Sat, 11 Oct 2025 20:00:01 +0800 Subject: [PATCH] fix(components): [upload] Invalid CSS variable (#22366) * fix: upload css var * fix: inject the scss variables in the component level * fix: Excess modifications * fix: Keep the name consistent with the original * fix: Keep the name consistent with the original --- packages/theme-chalk/src/common/var.scss | 4 ++++ packages/theme-chalk/src/upload.scss | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/theme-chalk/src/common/var.scss b/packages/theme-chalk/src/common/var.scss index a87c1d4c32..09319b41d2 100644 --- a/packages/theme-chalk/src/common/var.scss +++ b/packages/theme-chalk/src/common/var.scss @@ -1565,6 +1565,10 @@ $upload: map.merge( ( 'dragger-padding-horizontal': 40px, 'dragger-padding-vertical': 10px, + 'list-picture-card-size': var( + #{getCssVarName('upload', 'picture-card-size')} + ), + 'picture-card-size': 148px, ), $upload ); diff --git a/packages/theme-chalk/src/upload.scss b/packages/theme-chalk/src/upload.scss index 0162696b8b..c90010824a 100644 --- a/packages/theme-chalk/src/upload.scss +++ b/packages/theme-chalk/src/upload.scss @@ -77,8 +77,6 @@ /* Picture Card for Wall */ @include m(picture-card) { - @include set-css-var-value(('upload', 'picture-card', 'size'), 148px); - background-color: getCssVar('fill-color', 'lighter'); border: 1px dashed getCssVar('border-color', 'darker'); border-radius: 6px; @@ -167,6 +165,10 @@ } } +@include b(upload-list) { + @include set-component-css-var('upload', $upload); +} + @include b(upload-list) { margin: 10px 0 0; padding: 0; @@ -343,8 +345,6 @@ // upload-list @include m(picture-card) { - @include set-css-var-value(('upload-list', 'picture-card', 'size'), 148px); - display: inline-flex; flex-wrap: wrap; margin: 0;