Skip to content

Commit

Permalink
[@mantine/core] Alert: Fix content overlap with no title and with clo…
Browse files Browse the repository at this point in the history
…se button (#3681)

Co-authored-by: Ilya Krasov <krasov@addamant.ru>
  • Loading branch information
ForeshadowRU and Ilya Krasov committed Mar 8, 2023
1 parent 8df978b commit a2c3f82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
8 changes: 3 additions & 5 deletions src/mantine-core/src/Alert/Alert.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default createStyles((theme, { radius, color }: AlertStylesParams, { vari
paddingTop: theme.spacing.sm,
paddingBottom: theme.spacing.sm,
paddingLeft: theme.spacing.md,
paddingRight: theme.spacing.md,
paddingRight: theme.spacing.sm,
borderRadius: theme.fn.radius(radius),
border: `${rem(1)} solid transparent`,
...getVariantStyles({ variant, color, theme }),
Expand Down Expand Up @@ -122,9 +122,7 @@ export default createStyles((theme, { radius, color }: AlertStylesParams, { vari
},

closeButton: {
position: 'absolute',
top: theme.spacing.sm,
right: theme.spacing.sm,
color: 'inherit',
width: rem(10),
height: rem(10),
},
}));
22 changes: 11 additions & 11 deletions src/mantine-core/src/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ export const Alert = forwardRef<HTMLDivElement, AlertProps>((props: AlertProps,
</div>
)}

{withCloseButton && (
<CloseButton
className={classes.closeButton}
onClick={onClose}
variant="transparent"
size={16}
iconSize={16}
aria-label={closeButtonLabel}
/>
)}

<div id={bodyId} className={classes.message}>
{children}
</div>
</div>

{withCloseButton && (
<CloseButton
className={classes.closeButton}
onClick={onClose}
variant="transparent"
size={16}
iconSize={16}
aria-label={closeButtonLabel}
/>
)}
</div>
</Box>
);
Expand Down

0 comments on commit a2c3f82

Please sign in to comment.