diff --git a/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts b/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts index 83ebbc74bf..6fea8ad6ce 100644 --- a/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts +++ b/examples/sites/demos/pc/app/file-upload/upload-file-list.spec.ts @@ -15,7 +15,8 @@ test('文件列表', async ({ page }) => { const currentPath = path.resolve(__dirname, '测试.jpg') await expect(width).toBeGreaterThanOrEqual(height) - await expect(height).toBeGreaterThanOrEqual(22, 0) + // 行高取1.5,计算结果是21 + await expect(height).toBeGreaterThanOrEqual(21, 0) await expect(items).toHaveCount(2) await expect(items).toHaveText([/test1/, /test2/]) await fileChooser.setFiles(currentPath) diff --git a/packages/theme/src/file-upload/index.less b/packages/theme/src/file-upload/index.less index e64ad09115..15d71fcee2 100644 --- a/packages/theme/src/file-upload/index.less +++ b/packages/theme/src/file-upload/index.less @@ -11,10 +11,13 @@ */ @import '../custom.less'; +@import './vars.less'; @upload-thumb-prefix-cls: ~'@{css-prefix}upload--thumb'; .@{upload-thumb-prefix-cls} { + .inject-FileUpload-vars(); + &__wrap { margin-top: 8px; } @@ -22,24 +25,29 @@ &__head { cursor: pointer; color: #343434; - font-size: var(--ti-common-font-size-1); + font-size: var(--tv-FileUpload-font-size); + .thumb-icon { margin-right: 8px; fill: #999; } + span { vertical-align: middle; } } + &__body { .thumb-item { display: flex; justify-content: flex-start; align-items: center; + &:not(:last-child) { padding-bottom: 8px; } } + .thumb-item-name { padding: 4px 8px; color: #333; diff --git a/packages/theme/src/file-upload/vars.less b/packages/theme/src/file-upload/vars.less index 7925ec7935..9e32f1e354 100644 --- a/packages/theme/src/file-upload/vars.less +++ b/packages/theme/src/file-upload/vars.less @@ -9,3 +9,7 @@ * A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. * */ + +.inject-FileUpload-vars() { + --tv-FileUpload-font-size: var(--tv-font-size-md); +} diff --git a/packages/theme/src/upload-dragger/index.less b/packages/theme/src/upload-dragger/index.less index 58f4f4602b..556180449b 100644 --- a/packages/theme/src/upload-dragger/index.less +++ b/packages/theme/src/upload-dragger/index.less @@ -18,15 +18,15 @@ @upload-dragger-prefix-cls: ~'@{css-prefix}upload-dragger'; .@{file-upload-prefix-cls} { - .component-css-vars-upload-dragger(); + .inject-UploadDragger-vars(); } .@{upload-dragger-prefix-cls} { - width: var(--ti-upload-dragger-width); - height: var(--ti-upload-dragger-height); - background-color: var(--ti-upload-dragger-bg-color); - border: 1px dashed var(--ti-upload-dragger-border-color); - border-radius: var(--ti-upload-dragger-border-radius); + width: var(--tv-UploadDragger-width); + height: var(--tv-UploadDragger-height); + background-color: var(--tv-UploadDragger-bg-color); + border: 1px dashed var(--tv-UploadDragger-border-color); + border-radius: var(--tv-UploadDragger-border-radius); box-sizing: border-box; text-align: center; overflow: hidden; @@ -36,27 +36,27 @@ align-items: center; &:hover { - border-color: var(--ti-upload-dragger-hover-text-color); + border-color: var(--tv-UploadDragger-hover-text-color); } &.is-dragover { - background-color: var(--ti-upload-dragger-dragover-bg-color, rgba(32, 159, 255, 0.06)); - border: 2px dashed var(--ti-upload-dragger-hover-text-color); + background-color: var(--tv-UploadDragger-dragover-bg-color, rgba(32, 159, 255, 0.06)); + border: 2px dashed var(--tv-UploadDragger-hover-text-color); } .icon-fileupload { - font-size: var(--ti-upload-dragger-icon-font-size); - fill: var(--ti-upload-dragger-icon-color); + font-size: var(--tv-UploadDragger-icon-font-size); + fill: var(--tv-UploadDragger-icon-color); } .@{upload-prefix-cls}__text { - color: var(--ti-upload-dragger-text-color); - font-size: var(--ti-upload-dragger-text-font-size); + color: var(--tv-UploadDragger-text-color); + font-size: var(--tv-UploadDragger-text-font-size); text-align: center; line-height: 1.5; em { - color: var(--ti-upload-dragger-hover-text-color); + color: var(--tv-UploadDragger-hover-text-color); font-style: normal; } } @@ -66,7 +66,7 @@ } & ~ .@{upload-prefix-cls}__files { - border-top: 1px solid var(--ti-upload-dragger-files-border-color); + border-top: 1px solid var(--tv-UploadDragger-files-border-color); margin-top: 7px; padding-top: 5px; } diff --git a/packages/theme/src/upload-dragger/vars.less b/packages/theme/src/upload-dragger/vars.less index 42672c5d39..b6d6e43510 100644 --- a/packages/theme/src/upload-dragger/vars.less +++ b/packages/theme/src/upload-dragger/vars.less @@ -10,29 +10,29 @@ * */ -.component-css-vars-upload-dragger() { +.inject-UploadDragger-vars() { // 拖拽上传框宽度 - --ti-upload-dragger-width: 100px; + --tv-UploadDragger-width: 100px; // 拖拽上传框高度 - --ti-upload-dragger-height: 100px; + --tv-UploadDragger-height: 100px; // 拖拽上传框背景色 - --ti-upload-dragger-bg-color: var(--ti-common-color-bg-gray, #fafafa); + --tv-UploadDragger-bg-color: var(--tv-color-bg-gray-1); // 拖拽上传框边框色 - --ti-upload-dragger-border-color: var(--ti-common-color-border, #999999); + --tv-UploadDragger-border-color: var(--tv-color-border); // 拖拽上传框圆角 - --ti-upload-dragger-border-radius: var(--ti-common-border-radius-normal, 6px); + --tv-UploadDragger-border-radius: var(--tv-border-radius-md); // 拖拽上传框(链接文本|悬浮边框)色 - --ti-upload-dragger-hover-text-color: var(--ti-common-color-primary-hover, #595959); + --tv-UploadDragger-hover-text-color: var(--tv-color-text-secondary); // 文件拖到框内上传框背景色 - --ti-upload-dragger-dragover-bg-color: rgba(32, 159, 255, 0.06); + --tv-UploadDragger-dragover-bg-color: rgba(32, 159, 255, 0.06); // 拖拽上传框内图标色 - --ti-upload-dragger-icon-color: #191919; + --tv-UploadDragger-icon-color: var(--tv-color-icon-control); // 拖拽上传框内图标尺寸 - --ti-upload-dragger-icon-font-size: 24px; + --tv-UploadDragger-icon-font-size: 24px; // 拖拽上传框内文本色 - --ti-upload-dragger-text-color: var(--ti-common-color-text-secondary, #595959); + --tv-UploadDragger-text-color: var(--tv-color-text-secondary); // 拖拽上传框内字号 - --ti-upload-dragger-text-font-size: var(--ti-common-font-size-base, 14px); + --tv-UploadDragger-text-font-size: var(--tv-font-size-md); // 拖拽上传框文件列表边框色(hide) - --ti-upload-dragger-files-border-color: #dcdfe6; + --tv-UploadDragger-files-border-color: #dcdfe6; } diff --git a/packages/theme/src/upload-list/index.less b/packages/theme/src/upload-list/index.less index e89ea5f7eb..49d8ee5f4b 100644 --- a/packages/theme/src/upload-list/index.less +++ b/packages/theme/src/upload-list/index.less @@ -22,7 +22,7 @@ @tooltip-prefix-cls: ~'@{css-prefix}tooltip'; .@{file-upload-prefix-cls} { - .component-css-vars-upload-list(); + .inject-UploadList-vars(); &.@{tooltip-prefix-cls} { margin-bottom: 7px; @@ -40,17 +40,17 @@ a:hover { color: #333; - text-decoration: var(--ti-upload-list-item-hover-text-decoration); + text-decoration: none; } // 提高优先级覆盖ul.li样式 &--text { li:first-of-type > .@{upload-list-prefix-cls}__item { - margin-top: calc(var(--ti-upload-list-item-margin-top) + 4px); + margin-top: calc(var(--tv-UploadList-item-margin-top) + 4px); } li:not(:first-of-type) > .@{upload-list-prefix-cls}__item { - margin-top: var(--ti-upload-list-item-margin-top); + margin-top: var(--tv-UploadList-item-margin-top); } li:last-of-type { @@ -67,26 +67,27 @@ &__item.is-fail { .@{upload-list-prefix-cls}__item-name { - color: var(--ti-upload-list-item-fail-text-color); + color: var(--tv-UploadList-item-fail-text-color); + & .tiny-svg { - fill: var(--ti-upload-list-item-fail-text-color); + fill: var(--tv-UploadList-item-fail-text-color); } } } &__item { transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1); - font-size: var(--ti-upload-list-item-font-size); - color: var(--ti-upload-list-item-text-color); - line-height: var(--ti-upload-list-item-line-height); + font-size: var(--tv-UploadList-item-font-size); + color: var(--tv-UploadList-item-text-color); + line-height: var(--tv-UploadList-item-line-height); position: relative; box-sizing: border-box; - border-radius: var(--ti-upload-list-item-border-radius); + border-radius: var(--tv-UploadList-item-border-radius); width: 100%; outline: none; &:hover { - background-color: var(--ti-upload-list-item-hover-background-color); + background-color: var(--tv-UploadList-item-hover-background-color); .@{svg-prefix-cls}.icon-close, .@{svg-prefix-cls}.icon-refres { @@ -105,7 +106,7 @@ .@{upload-list-prefix-cls}__item-name:focus, .@{upload-list-prefix-cls}__item-name:hover { - color: var(--ti-upload-list-item-hover-text-color); + color: var(--tv-UploadList-item-hover-text-color); cursor: pointer; text-decoration: none; } @@ -191,7 +192,7 @@ .@{progress-prefix-cls} { position: absolute; - top: var(--ti-upload-list-item-progress-top); + top: 26px; width: 100%; } @@ -210,25 +211,25 @@ > .@{upload-list-prefix-cls}__item-actions > &-delete > .@{svg-prefix-cls}.@{svg-prefix-cls}-size.icon-delete { - fill: var(--ti-upload-list-svg-close-icon-color); + fill: var(--tv-UploadList-svg-close-icon-color); &:hover { - fill: var(--ti-upload-list-svg-close-hover-icon-color); + fill: var(--tv-UploadList-svg-close-hover-icon-color); } } .@{svg-prefix-cls} { &.icon-successful { - font-size: var(--ti-upload-list-successful-icon-font-size); - fill: var(--ti-upload-list-successful-status-bg-color); + font-size: var(--tv-UploadList-successful-icon-font-size); + fill: var(--tv-UploadList-successful-status-bg-color); } &.icon-close { - right: var(--ti-upload-list-svg-close-position-right); + right: 8px; } &.icon-refres { - right: var(--ti-upload-list-svg-refresh-position-right); + right: 32px; } &.icon-close, @@ -237,13 +238,13 @@ position: absolute; top: 50%; transform: translateY(-50%); - fill: var(--ti-upload-list-svg-close-icon-color); - font-size: var(--ti-upload-list-svg-icon-font-size); + fill: var(--tv-UploadList-svg-close-icon-color); + font-size: var(--tv-UploadList-svg-icon-font-size); opacity: 0.75; cursor: pointer; &:hover { - fill: var(--ti-upload-list-svg-close-hover-icon-color); + fill: var(--tv-UploadList-svg-close-hover-icon-color); opacity: 1; } } @@ -254,10 +255,10 @@ position: absolute; top: 5px; right: 5px; - font-size: var(--ti-upload-list-svg-icon-font-size); + font-size: var(--tv-UploadList-svg-icon-font-size); cursor: pointer; opacity: 1; - color: var(--ti-upload-list-item-hover-text-color); + color: var(--tv-UploadList-item-hover-text-color); } } @@ -286,7 +287,7 @@ font-size: 14px; height: 22px; line-height: 22px; - color: var(--ti-upload-list-item-fail-text-color); + color: var(--tv-UploadList-item-fail-text-color); } &__icon-operationfaild { @@ -303,16 +304,16 @@ } &__item-name { - color: var(--ti-upload-list-item-text-color); + color: var(--tv-UploadList-item-text-color); display: block; margin-right: 40px; padding-left: 4px; transition: color 0.3s; .@{svg-prefix-cls} { - font-size: var(--ti-upload-list-item-name-icon-font-size); + font-size: var(--tv-UploadList-item-name-icon-font-size); margin-right: 4px; - fill: var(--ti-upload-list-item-name-icon-color); + fill: var(--tv-UploadList-item-name-icon-color); } } @@ -328,12 +329,12 @@ position: absolute; right: 10px; top: 0; - font-size: var(--ti-upload-list-svg-icon-font-size); - color: var(--ti-upload-list-svg-close-icon-color); + font-size: var(--tv-UploadList-svg-icon-font-size); + color: var(--tv-UploadList-svg-close-icon-color); display: none; &:hover { - color: var(--ti-upload-list-item-hover-text-color); + color: var(--tv-UploadList-item-hover-text-color); } } @@ -353,7 +354,7 @@ display: inline-block; .is-fail { - color: var(--ti-upload-list-item-fail-text-color); + color: var(--tv-UploadList-item-fail-text-color); } &-title:not(.is-fail) { @@ -364,7 +365,7 @@ margin-top: -4px; text-align: center; line-height: 1.5; - width: var(--ti-upload-list-picture-card-width); + width: var(--tv-UploadList-picture-card-width); height: 18px; font-size: 12px; overflow: hidden; @@ -375,36 +376,35 @@ .@{upload-list-prefix-cls}__item { overflow: hidden; - background-color: var(--ti-upload-list-picture-card-item-bg-color); - border: 1px var(--ti-upload-list-picture-card-loading-border-color) - var(--ti-upload-list-picture-card-item-border-color); - border-radius: var(--ti-upload-list-item-border-radius); + background-color: var(--tv-UploadList-picture-card-item-bg-color); + border: 1px dashed var(--tv-UploadList-picture-card-item-border-color); + border-radius: var(--tv-UploadList-item-border-radius); box-sizing: border-box; - width: var(--ti-upload-list-picture-card-width); - height: var(--ti-upload-list-picture-card-height); - margin: 0 var(--ti-upload-list-picture-card-item-margin-right) 8px 0; + width: var(--tv-UploadList-picture-card-width); + height: var(--tv-UploadList-picture-card-height); + margin: 0 16px 8px 0; display: inline-block; &.is-success { - border-width: var(--ti-upload-list-picture-success-border-weight); + border-width: 0; } &.is-fail { border-style: solid; - border-color: var(--ti-upload-list-item-fail-text-color); + border-color: var(--tv-UploadList-item-fail-text-color); background-color: #fce3e1; .@{upload-list-prefix-cls}__item-actions:hover { background-color: #fce3e1; & span .tiny-svg { - fill: var(--ti-upload-list-svg-close-hover-icon-color); + fill: var(--tv-UploadList-svg-close-hover-icon-color); } } } .@{icon-check-prefix-cls} { - fill: var(--ti-upload-list-picture-card-item-text-color); + fill: var(--tv-UploadList-picture-card-item-icon-color); } .@{svg-prefix-cls}.icon-close, @@ -433,13 +433,13 @@ top: -6px; width: 40px; height: 24px; - background: var(--ti-upload-list-successful-status-bg-color); + background: var(--tv-UploadList-successful-status-bg-color); text-align: center; transform: rotate(45deg); box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2); .@{svg-prefix-cls} { - font-size: var(--ti-upload-list-svg-icon-font-size, 12px); + font-size: var(--tv-UploadList-svg-icon-font-size); margin-top: 11px; transform: rotate(-45deg); } @@ -453,13 +453,13 @@ top: 0; cursor: default; text-align: center; - fill: var(--ti-upload-list-picture-card-item-icon-color); + fill: var(--tv-UploadList-picture-card-item-icon-color); opacity: 0; font-size: var(--ti-common-font-size-4); - background-color: var(--ti-upload-list-picture-card-item-hover-bg-color); + background-color: transparent; transition: opacity 0.3s; - &::after { + &:after { display: inline-block; content: ''; height: 100%; @@ -502,7 +502,7 @@ left: 50%; transform: translate(-50%, -50%); bottom: auto; - width: var(--ti-upload-list-picture-card-progress-size); + width: var(--tv-UploadList-picture-card-progress-size); .@{progress-prefix-cls}__text { top: 50%; @@ -527,13 +527,13 @@ &--picture &__item { overflow: hidden; z-index: 0; - background-color: var(--ti-upload-list-picture-card-item-bg-color); + background-color: var(--tv-UploadList-picture-card-item-bg-color); box-sizing: border-box; margin-top: 8px; outline: 0; .@{icon-check-prefix-cls} { - fill: var(--ti-upload-list-picture-card-item-text-color); + fill: var(--tv-UploadList-picture-card-item-icon-color); } &:hover { @@ -564,8 +564,8 @@ &--picture &__item-thumbnail { width: 56px; height: 56px; - border: 1px solid var(--ti-upload-list-picture-card-item-border-color); - border-radius: var(--ti-upload-list-item-border-radius); + border: 1px solid var(--tv-UploadList-picture-card-item-border-color); + border-radius: var(--tv-UploadList-item-border-radius); float: left; position: relative; z-index: 1; @@ -588,13 +588,13 @@ top: -7px; width: 46px; height: 26px; - background: var(--ti-upload-list-successful-status-bg-color); + background: var(--tv-UploadList-successful-status-bg-color); text-align: center; transform: rotate(45deg); box-shadow: 0 1px 1px #ccc; .@{svg-prefix-cls} { - font-size: var(--ti-upload-list-svg-icon-font-size); + font-size: var(--tv-UploadList-svg-icon-font-size); margin-top: 12px; transform: rotate(-45deg); } diff --git a/packages/theme/src/upload-list/vars.less b/packages/theme/src/upload-list/vars.less index 84ab74a60c..b83c8340b3 100644 --- a/packages/theme/src/upload-list/vars.less +++ b/packages/theme/src/upload-list/vars.less @@ -10,65 +10,47 @@ * */ -.component-css-vars-upload-list() { +.inject-UploadList-vars() { // 上传文件列表字号 - --ti-upload-list-item-font-size: var(--ti-common-font-size-1, 14px); + --tv-UploadList-item-font-size: var(--tv-font-size-md); // 上传文件列表文本色 - --ti-upload-list-item-text-color: var(--ti-common-color-text-secondary, #595959); + --tv-UploadList-item-text-color: var(--tv-color-text-secondary); // 上传文件列表项(图片框|悬浮背景)圆角 - --ti-upload-list-item-border-radius: var(--ti-common-border-radius-4, 8px); + --tv-UploadList-item-border-radius: var(--tv-border-radius-lg); // 上传文件列表项悬浮背景色 - --ti-upload-list-item-hover-background-color: var(--ti-common-color-bg-normal, #f5f5f5); + --tv-UploadList-item-hover-background-color: var(--tv-color-bg-hover); // 上传成功列表项悬浮文本色 - --ti-upload-list-item-hover-text-color: var(--ti-common-color-primary-hover, #595959); - // 上传文件列表项悬浮下划线(hide) - --ti-upload-list-item-hover-text-decoration: none; + --tv-UploadList-item-hover-text-color: var(--tv-color-text-secondary); // 上传文件列表项前置图标色 - --ti-upload-list-item-name-icon-color: var(--ti-common-color-primary-normal, #191919); + --tv-UploadList-item-name-icon-color: var(--tv-color-icon-control); // 上传文件列表项前置图标尺寸 - --ti-upload-list-item-name-icon-font-size: var(--ti-common-font-size-2, 16px); + --tv-UploadList-item-name-icon-font-size: var(--tv-icon-size); // 上传文件列表项右侧图标色 - --ti-upload-list-svg-close-icon-color: var(--ti-common-color-icon-normal, #808080); + --tv-UploadList-svg-close-icon-color: var(--tv-color-icon); // 上传文件列表项右侧悬浮图标色 - --ti-upload-list-svg-close-hover-icon-color: var(--ti-common-color-icon-hover, #191919); + --tv-UploadList-svg-close-hover-icon-color: var(--tv-color-icon-hover); // 上传文件列表项图标尺寸 - --ti-upload-list-svg-icon-font-size: var(--ti-common-font-size-2, 16px); + --tv-UploadList-svg-icon-font-size: var(--tv-icon-size); // 上传文件列表项成功图标尺寸 - --ti-upload-list-successful-icon-font-size: var(--ti-common-font-size-1, 14px); - // 照片墙上传列表项上传中边框样式 - --ti-upload-list-picture-card-loading-border-color: dashed; + --tv-UploadList-successful-icon-font-size: var(--tv-font-size-md); // 照片墙上传列表项边框色 - --ti-upload-list-picture-card-item-border-color: var(--ti-common-color-line-normal, #c2c2c2); - // 照片墙上传成功列表项边框厚度 - --ti-upload-list-picture-success-border-weight: 0; + --tv-UploadList-picture-card-item-border-color: var(--tv-color-border); // 照片墙上传列表项背景色 - --ti-upload-list-picture-card-item-bg-color: var(--ti-common-color-light, #ffffff); + --tv-UploadList-picture-card-item-bg-color: var(--tv-color-bg-secondary); // 照片墙上传列表项右上角图标填充色 - --ti-upload-list-picture-card-item-text-color: var(--ti-common-color-light, #ffffff); + --tv-UploadList-picture-card-item-icon-color: var(--tv-color-icon-white); // 上传列表项成功状态图标色或背景色 - --ti-upload-list-successful-status-bg-color: var(--ti-common-color-success-normal, #5cb300); + --tv-UploadList-successful-status-bg-color: var(--tv-color-success-bg); // 照片墙上传列表项宽度(new) - --ti-upload-list-picture-card-width: var(--ti-common-size-25x, 100px); + --tv-UploadList-picture-card-width: 100px; // 照片墙上传列表项高度(new) - --ti-upload-list-picture-card-height: var(--ti-common-size-25x, 100px); + --tv-UploadList-picture-card-height: 100px; // 照片墙上传列表项进度条尺寸(new) - --ti-upload-list-picture-card-progress-size: var(--ti-common-size-17x, 68px); - // 照片墙上传列表项按钮颜色(new) - --ti-upload-list-picture-card-item-icon-color: var(--ti-common-color-light, #ffffff); - // 照片墙上传列表项右外边距(new) - --ti-upload-list-picture-card-item-margin-right: var(--ti-common-space-4x, 16px); - // 非picturecard模式上传列表进度条上外边距(hide) - --ti-upload-list-item-progress-top: calc(var(--ti-common-line-height-2, 24px) + 2px); + --tv-UploadList-picture-card-progress-size: 68px; // 非picturecard模式上传文件列表文本行高(new) - --ti-upload-list-item-line-height: var(--ti-common-line-height-1, 22px); + --tv-UploadList-item-line-height: var(--tv-line-height-number); // 非picturecard模式上传文件列表文本上外边距(new) - --ti-upload-list-item-margin-top: var(--ti-common-space-2x, 8px); + --tv-UploadList-item-margin-top: var(--tv-space-md); // 上传文件列表项失败文本和图标色 - --ti-upload-list-item-fail-text-color: #f23030; - // 上传文件列表项刷新图标右边距(hide) - --ti-upload-list-svg-refresh-position-right: var(--ti-common-space-8x, 32px); - // 上传文件列表项删除图标右边距(hide) - --ti-upload-list-svg-close-position-right: var(--ti-common-space-2x, 8px); - // 照片墙上传列表项悬浮背景色(new) - --ti-upload-list-picture-card-item-hover-bg-color: var(--ti-common-bg-color-hover-40, var(--ti-base-bg-color-transparent-40)); + --tv-UploadList-item-fail-text-color: var(--tv-color-error-text); } diff --git a/packages/theme/src/upload/index.less b/packages/theme/src/upload/index.less index aa6cdefaba..8d0f602952 100644 --- a/packages/theme/src/upload/index.less +++ b/packages/theme/src/upload/index.less @@ -18,7 +18,7 @@ @upload-cover-prefix-cls: ~'@{css-prefix}upload-cover'; .@{file-upload-prefix-cls} { - .component-css-vars-upload(); + .inject-Upload-vars(); } .@{upload-prefix-cls} { @@ -32,35 +32,35 @@ } &__tip { - font-size: var(--ti-upload-tip-font-size); - color: var(--ti-upload-tip-text-color); + font-size: var(--tv-Upload-tip-font-size); + color: var(--tv-Upload-tip-text-color); margin-top: 8px; } &--picture-card { - width: var(--ti-upload-picture-card-width); - height: var(--ti-upload-picture-card-height); - line-height: calc(var(--ti-upload-picture-card-height) - 2px); - background-color: var(--ti-upload-picture-card-bg-color); - border: 1px dashed var(--ti-upload-picture-card-border-color); - border-radius: var(--ti-upload-picture-card-border-radius); + width: var(--tv-Upload-picture-card-width); + height: var(--tv-Upload-picture-card-height); + line-height: calc(var(--tv-Upload-picture-card-height) - 2px); + background-color: var(--tv-Upload-picture-card-bg-color); + border: 1px dashed var(--tv-Upload-picture-card-border-color); + border-radius: var(--tv-Upload-picture-card-border-radius); box-sizing: border-box; vertical-align: top; svg { - font-size: var(--ti-upload-picture-card-icon-font-size); - fill: var(--ti-upload-picture-card-icon-color); + font-size: var(--tv-Upload-picture-card-icon-font-size); + fill: var(--tv-Upload-picture-card-icon-color); } } &--picture-card:hover, &:focus { - border-color: var(--ti-upload-picture-card-hover-border-color); - color: var(--ti-upload-picture-card-hover-border-color); + border-color: var(--tv-Upload-picture-card-hover-border-color); + color: var(--tv-Upload-picture-card-hover-border-color); } &:focus &-dragger { - border-color: var(--ti-upload-picture-card-hover-border-color); + border-color: var(--tv-Upload-picture-card-hover-border-color); } &-cover__title, @@ -236,7 +236,7 @@ .btn { display: inline-block; color: #fff; - font-size: var(--ti-common-font-size-1); + font-size: var(--tv-Upload-tip-font-size); cursor: pointer; vertical-align: middle; transition: @@ -282,7 +282,7 @@ font-weight: 400; padding: 0 10px; margin: 0; - font-size: var(--ti-common-font-size-1); + font-size: var(--tv-Upload-tip-font-size); color: #303133; text-align: left; } diff --git a/packages/theme/src/upload/vars.less b/packages/theme/src/upload/vars.less index 7f9aa67a00..74aa796ed1 100644 --- a/packages/theme/src/upload/vars.less +++ b/packages/theme/src/upload/vars.less @@ -10,25 +10,25 @@ * */ -.component-css-vars-upload() { +.inject-Upload-vars() { // 自定义上传提示字号 - --ti-upload-tip-font-size: var(--ti-common-font-size-base, 14px); + --tv-Upload-tip-font-size: var(--tv-font-size-md); // 自定义上传提示文本色 - --ti-upload-tip-text-color: #808080; + --tv-Upload-tip-text-color: var(--tv-color-text-weaken); // 照片墙上传按钮背景色 - --ti-upload-picture-card-bg-color: #FFFFFF; + --tv-Upload-picture-card-bg-color: var(--tv-color-bg-secondary); // 照片墙上传按钮边框色 - --ti-upload-picture-card-border-color: var(--ti-common-color-line-normal, #c2c2c2); + --tv-Upload-picture-card-border-color: var(--tv-color-border); // 照片墙上传按钮圆角 - --ti-upload-picture-card-border-radius: 6px; + --tv-Upload-picture-card-border-radius: var(--tv-border-radius-md); // 照片墙上传按钮悬浮边框色 - --ti-upload-picture-card-hover-border-color: var(--ti-common-color-dash-line-hover, #191919); + --tv-Upload-picture-card-hover-border-color: var(--tv-color-border-hover); // 照片墙上传按钮图标尺寸 - --ti-upload-picture-card-icon-font-size: var(--ti-common-font-size-5, 24px); + --tv-Upload-picture-card-icon-font-size: 24px; // 照片墙上传按钮图标色 - --ti-upload-picture-card-icon-color: #191919; + --tv-Upload-picture-card-icon-color: var(--tv-color-icon-control); // 拖拽上传区域宽度 - --ti-upload-picture-card-width: 100px; + --tv-Upload-picture-card-width: 100px; // 拖拽上传区域高度 - --ti-upload-picture-card-height: 100px; + --tv-Upload-picture-card-height: 100px; }