Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(grid): [grid] refactor grid radio style #2462

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions packages/theme/src/grid/radio.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,32 @@
}

&:checked + .@{grid-radio-prefix-cls}__icon {
position: relative;
width: var(--tv-Grid-icon-size);
height: var(--tv-Grid-icon-size);
margin: 1px;
border: 1px solid var(--tv-Grid-radio-icon-color-selected);
border-radius: 100%;

&::after {
content: '';
height: 8px;
width: 8px;
background: var(--tv-Grid-radio-icon-color-selected);
position: absolute;
border-radius: 100%;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}

> svg {
&.icon-radio {
display: none;
}

&.icon-radio-selected {
display: inline-block;
fill: var(--tv-Grid-radio-icon-color-selected);
display: none;
}
}

Expand All @@ -70,7 +88,7 @@
> input {
& + .@{grid-radio-prefix-cls}__icon {
> svg {
fill: var(--tv-Grid-radio-icon-color-disabled);
fill: var(--tv-Grid-radio-border-color-disabled);

path:last-child {
fill: var(--tv-Grid-radio-icon-color-disabled);
Expand All @@ -83,12 +101,10 @@
}

&:checked + .@{grid-radio-prefix-cls}__icon {
> svg {
fill: var(--tv-Grid-radio-icon-color-disabled);
border-color: var(--tv-Grid-radio-border-color-disabled);

path:first-child {
fill: var(--tv-Grid-radio-icon-color-disabled);
}
&::after {
background: var(--tv-Grid-radio-border-color-disabled);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/src/grid/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
--tv-Grid-radio-icon-color-selected: var(--tv-color-bg-active-control);
// 单选框禁用颜色
--tv-Grid-radio-icon-color-disabled: var(--tv-color-bg-disabled);
// 单选框禁用边框色
--tv-Grid-radio-border-color-disabled: var(--tv-color-border-disabled);
// -------筛选相关样式-------
// 筛选一般背景色
--tv-Grid-filter-bg-color: var(--tv-color-bg);
Expand Down
Loading