Skip to content

Commit

Permalink
feat(radio): [radio] Adapting to the SMB theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Youyou-smiles committed Sep 14, 2024
1 parent 71b1eae commit 9923163
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/radio/basic-usage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ test('基本用法', async ({ page }) => {
return {}
})

expect(afterElement.backgroundColor).toBe('rgb(94, 124, 224)')
expect(afterElement.backgroundColor).toBe('rgb(20, 118, 255)')
})
6 changes: 3 additions & 3 deletions examples/sites/demos/pc/app/radio/radio-size.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ test('尺寸设置', async ({ page }) => {
const demo = page.locator('#radio-size')
const radioGroup = demo.locator('.tiny-radio-group')

await expect(radioGroup.first()).toHaveCSS('width', '183px')
await expect(radioGroup.first()).toHaveCSS('width', '184px')
await expect(radioGroup.first()).toHaveCSS('height', '32px')
await expect(radioGroup.nth(1)).toHaveCSS('width', '171px')
await expect(radioGroup.nth(1)).toHaveCSS('width', '184px')
await expect(radioGroup.nth(1)).toHaveCSS('height', '28px')
await expect(radioGroup.nth(2)).toHaveCSS('width', '139px')
await expect(radioGroup.nth(2)).toHaveCSS('width', '152px')
await expect(radioGroup.nth(2)).toHaveCSS('height', '24px')
})
9 changes: 0 additions & 9 deletions packages/theme/src/radio-button/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

border-radius: var(--ti-radio-button-border-radius);
&:first-child &__inner {
border-left: var(--ti-radio-button-border-left) solid var(--ti-radio-button-border-color);
border-radius: var(--ti-radio-button-child-left-border-radius) var(--ti-radio-button-child-right-border-radius) var(--ti-radio-button-child-right-border-radius) var(--ti-radio-button-child-left-border-radius);
}

Expand Down Expand Up @@ -52,7 +51,6 @@
padding: var(--ti-radio-button-padding-verticals) 24px;
font-weight: 500;
border-radius: var(--ti-radio-button-border-radius);
border-left: 0;
line-height: 1;
white-space: nowrap;
vertical-align: middle;
Expand All @@ -70,7 +68,6 @@
&:hover {
color: var(--ti-radio-button-hover-text-color);
background-color: var(--ti-radio-button-checked-hover-bg-color);
border-color: var(--ti-radio-button-checked-hover-border-color);
outline: 0;
}

Expand All @@ -93,12 +90,10 @@
& + .@{radio-button-prefix-cls}__inner {
color: #fff;
background-color: var(--ti-radio-button-checked-normal-bg-color);
border-color: var(--ti-radio-button-checked-normal-border-color);
box-shadow: var(--ti-radio-button-checked-normal-box-shadow);

&:hover {
background-color: var(--ti-radio-button-checked-hover-bg-color);
border-color: var(--ti-radio-button-checked-hover-border-color);
box-shadow: var(--ti-radio-button-checked-hover-box-shadow);
}
}
Expand All @@ -119,10 +114,6 @@
& + .@{radio-button-prefix-cls}__inner {
background-color: var(--ti-radio-button-checked-disabled-bg-color);
color: var(--ti-radio-button-disabled-checked-text-color);
&,
&:hover {
border-color: var(--ti-radio-button-checked-disabled-border-color);
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/theme/src/radio-button/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
.component-css-vars-radio-button() {
--ti-radio-button-text-color: var(--ti-common-color-text-secondary);
--ti-radio-button-hover-text-color: var(--ti-common-color-bg-emphasize);
--ti-radio-button-border-color: var(--ti-common-color-border, #adb0b8);
--ti-radio-button-border-radius: var(--ti-common-space-6);
--ti-radio-button-font-size: var(--ti-common-font-size-base, 12px);
--ti-radio-button-bg-color: var(--ti-common-color-bg-normal);
--ti-radio-button-checked-normal-bg-color: #1476FF;
--ti-radio-button-checked-normal-border-color: #1476FF;
--ti-radio-button-checked-normal-box-shadow: #1476FF;
--ti-radio-button-checked-hover-bg-color: var(--ti-common-color-prompt-bg);
--ti-radio-button-checked-hover-border-color: #1293ff;
--ti-radio-button-checked-hover-box-shadow: #1293ff;
--ti-radio-button-disabled-text-color: var(--ti-common-color-text-disabled, #adb0b8);
--ti-radio-button-disabled-checked-text-color: var(--ti-common-color-text-weaken);
Expand Down
6 changes: 0 additions & 6 deletions packages/theme/src/radio-group/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

&:first-child .@{radio-button-prefix-cls}__inner {
border-radius: var(--ti-radio-button-top-border-radius) var(--ti-radio-button-top-border-radius) var(--ti-radio-button-bottom-border-radius) var(--ti-radio-button-bottom-border-radius);
border-top: var(--ti-radio-button-border-top) solid var(--ti-radio-button-border-color);
}

&:last-child .@{radio-button-prefix-cls}__inner {
Expand All @@ -58,10 +57,5 @@
border-color: var(--ti-radio-input-checked-disabled-border-color);
}
}

.@{radio-button-prefix-cls}__inner {
border-top: 0;
border-left: 1px solid var(--ti-radio-button-border-color);
}
}
}
1 change: 0 additions & 1 deletion packages/theme/src/radio-group/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
--ti-radio-button-margin-bottom: 2px;
--ti-radio-button-top-border-radius: 6px;
--ti-radio-button-bottom-border-radius: 6px;
--ti-radio-button-border-top: 0;
}
2 changes: 1 addition & 1 deletion packages/vue/src/radio-group/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const radioGroupProps = {
modelValue: {},
size: {
type: String as PropType<'mini' | 'small' | 'medium'>,
default: ''
default: 'small'
},
fill: String,
textColor: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/radio/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const radioProps = {
border: Boolean,
size: {
type: String as PropType<'mini' | 'small' | 'medium'>,
default: ''
default: 'small'
},
text: String,
events: {
Expand Down

0 comments on commit 9923163

Please sign in to comment.