Skip to content

Commit

Permalink
[Joy] Adjust typography decorator margin (#34257)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Sep 10, 2022
1 parent 420e4a7 commit 552f04e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/data/joy/components/link/LinkAndTypography.js
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import Box from '@mui/joy/Box';
import Link from '@mui/joy/Link';
import Typography from '@mui/joy/Typography';
import CallMade from '@mui/icons-material/CallMade';
import Launch from '@mui/icons-material/Launch';
import LinkIcon from '@mui/icons-material/Link';

export default function LinkAndTypography() {
Expand Down Expand Up @@ -31,7 +31,7 @@ export default function LinkAndTypography() {
<Typography>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore{' '}
<Link href="#heading-demo" endDecorator={<CallMade />}>
<Link href="#heading-demo" endDecorator={<Launch />}>
Magna Aliqua
</Link>
. Maecenas sed enim ut sem viverra aliquet eget.
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-joy/src/Link/Link.tsx
Expand Up @@ -41,7 +41,7 @@ const StartDecorator = styled('span', {
overridesResolver: (props, styles) => styles.startDecorator,
})<{ ownerState: LinkOwnerState }>({
display: 'inline-flex',
marginInlineEnd: 'min(var(--Link-gap, 0.25em), 0.5rem)',
marginInlineEnd: 'clamp(4px, var(--Link-gap, 0.25em), 0.5rem)',
});

const EndDecorator = styled('span', {
Expand All @@ -50,7 +50,7 @@ const EndDecorator = styled('span', {
overridesResolver: (props, styles) => styles.endDecorator,
})<{ ownerState: LinkOwnerState }>({
display: 'inline-flex',
marginInlineStart: 'min(var(--Link-gap, 0.25em), 0.5rem)',
marginInlineStart: 'clamp(4px, var(--Link-gap, 0.25em), 0.5rem)',
});

const LinkRoot = styled('a', {
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-joy/src/Typography/Typography.tsx
Expand Up @@ -37,7 +37,7 @@ const StartDecorator = styled('span', {
overridesResolver: (props, styles) => styles.startDecorator,
})<{ ownerState: TypographyOwnerState }>(({ ownerState }) => ({
display: 'inline-flex',
marginInlineEnd: 'min(var(--Typography-gap, 0.25em), 0.5rem)',
marginInlineEnd: 'clamp(4px, var(--Typography-gap, 0.25em), 0.5rem)',
...((ownerState.sx as any)?.alignItems === 'flex-start' && {
marginTop: '2px', // this makes the alignment perfect in most cases
}),
Expand All @@ -49,7 +49,7 @@ const EndDecorator = styled('span', {
overridesResolver: (props, styles) => styles.endDecorator,
})<{ ownerState: TypographyOwnerState }>(({ ownerState }) => ({
display: 'inline-flex',
marginInlineStart: 'min(var(--Typography-gap, 0.25em), 0.5rem)',
marginInlineStart: 'clamp(4px, var(--Typography-gap, 0.25em), 0.5rem)',
...((ownerState.sx as any)?.alignItems === 'flex-start' && {
marginTop: '2px', // this makes the alignment perfect in most cases
}),
Expand Down

0 comments on commit 552f04e

Please sign in to comment.