From af800c5fb0c81119a18f571ed4931c2d33583b37 Mon Sep 17 00:00:00 2001 From: anlyyao Date: Tue, 20 Oct 2026 17:13:08 +0800 Subject: [PATCH] fix(Checkbox, Radio): unify circle icon border width to 1.5px --- packages/components/checkbox/checkbox.less | 49 ++++++++++++++-------- packages/components/radio/radio.less | 6 +-- 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/packages/components/checkbox/checkbox.less b/packages/components/checkbox/checkbox.less index b1df3ddb8..d5bc273e2 100644 --- a/packages/components/checkbox/checkbox.less +++ b/packages/components/checkbox/checkbox.less @@ -2,7 +2,6 @@ @checkbox: ~'@{prefix}-checkbox'; -@checkbox-border-width: 4rpx; @checkbox-icon-size: var(--td-checkbox-icon-size, 48rpx); @checkbox-title-font: var(--td-checkbox-title-font, @font-body-large); @checkbox-title-line-height: var(--td-checkbox-title-line-height, @text-line-height-m); @@ -101,32 +100,46 @@ } &-circle { - width: calc((@checkbox-icon-size - @checkbox-border-width) * 2); - height: calc((@checkbox-icon-size - @checkbox-border-width) * 2); - border: calc(@checkbox-border-width * 2) solid @checkbox-icon-color; - border-radius: @radius-circle; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) scale(0.5); + width: @checkbox-icon-size; + height: @checkbox-icon-size; box-sizing: border-box; - &--disabled { + &::after { + content: ''; + width: calc((@checkbox-icon-size - 4rpx) * 2); + height: calc((@checkbox-icon-size - 4rpx) * 2); + border-radius: @radius-circle; + border: 6rpx solid @checkbox-icon-color; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) scale(0.5); + box-sizing: border-box; + } + + &--disabled::after { background: @checkbox-icon-disabled-bg-color; } } &-rectangle { - width: calc((@checkbox-icon-size - @checkbox-border-width * 2) * 2); - height: calc((@checkbox-icon-size - @checkbox-border-width * 2) * 2); - border: calc(@checkbox-border-width * 2) solid @checkbox-icon-color; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%) scale(0.5); + width: @checkbox-icon-size; + height: @checkbox-icon-size; box-sizing: border-box; - &--disabled { + &::after { + content: ''; + width: calc((@checkbox-icon-size - 8rpx) * 2); + height: calc((@checkbox-icon-size - 8rpx) * 2); + border: 6rpx solid @checkbox-icon-color; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) scale(0.5); + box-sizing: border-box; + } + + &--disabled::after { background: @checkbox-icon-disabled-bg-color; } } diff --git a/packages/components/radio/radio.less b/packages/components/radio/radio.less index 870ce2144..37317ac6d 100644 --- a/packages/components/radio/radio.less +++ b/packages/components/radio/radio.less @@ -82,10 +82,10 @@ &::after { content: ''; - width: calc(200% - 6rpx); - height: calc(200% - 6rpx); + width: calc((@radio-icon-size - 4rpx) * 2); + height: calc((@radio-icon-size - 4rpx) * 2); border-radius: @radius-circle; - border: 3px solid @radio-icon-color; + border: 6rpx solid @radio-icon-color; position: absolute; top: 50%; left: 50%;