Skip to content

Commit

Permalink
[@mantine/core] Radio: Fix checked icon clipping and not being center…
Browse files Browse the repository at this point in the history
…ed with some sizes (#5064)

* [@mantine/core] Radio: fix radio icon size

* [@mantine/core] Radio: icon readability
  • Loading branch information
teh23 committed Oct 19, 2023
1 parent 5b861a7 commit 2e49cd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/mantine-core/src/components/Radio/Radio.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
--radio-size-xl: rem(36px);
--radio-size: var(--radio-size-sm);

--radio-icon-size: calc(var(--radio-size) / 2.25);
--radio-icon-size-xs: rem(6px);
--radio-icon-size-sm: rem(8px);
--radio-icon-size-md: rem(10px);
--radio-icon-size-lg: rem(14px);
--radio-icon-size-xl: rem(16px);
--radio-icon-size: var(--radio-icon-size-sm);
}

.inner {
Expand Down
1 change: 1 addition & 0 deletions src/mantine-core/src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const varsResolver = createVarsResolver<RadioFactory>((theme, { size, radius, co
'--radio-size': getSize(size, 'radio-size'),
'--radio-radius': radius === undefined ? undefined : getRadius(radius),
'--radio-color': color ? getThemeColor(color, theme) : undefined,
'--radio-icon-size': getSize(size, 'radio-icon-size'),
},
}));

Expand Down
2 changes: 1 addition & 1 deletion src/mantine-core/src/components/Radio/RadioIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function RadioIcon({ size, style, ...others }: RadioIconProps) {
style={{ width: rem(size), height: rem(size), ...style }}
{...others}
>
<path fill="currentColor" d="M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z" />
<circle cx="2.5" cy="2.5" r="2.5" fill="currentColor" />
</svg>
);
}

0 comments on commit 2e49cd4

Please sign in to comment.