From cf8660faa2909cf1c5a00685bc592d0987218ca8 Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Sat, 27 Aug 2022 17:32:18 +0300 Subject: [PATCH] [@mantine/core] TypographyStylesProvider: Fix code tag styles when it is nested within pre tag (#2219) --- .../TypographyStylesProvider.story.tsx | 22 +++++++++++++++++++ .../TypographyStylesProvider.styles.ts | 8 +++++++ 2 files changed, 30 insertions(+) create mode 100644 src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.story.tsx diff --git a/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.story.tsx b/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.story.tsx new file mode 100644 index 00000000000..6f35d8057f0 --- /dev/null +++ b/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.story.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import { TypographyStylesProvider } from './TypographyStylesProvider'; + +export default { title: 'TypographyStylesProvider' }; + +const content = ` +
{
+  "firstName": "John",
+  "lastName": "Smith",
+  "age": 25
+}
+`; + +export function CodeBlock() { + return ( +
+ +
+ +
+ ); +} diff --git a/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.styles.ts b/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.styles.ts index b24c7d2dbb6..09c0ffab3e7 100644 --- a/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.styles.ts +++ b/src/mantine-core/src/TypographyStylesProvider/TypographyStylesProvider.styles.ts @@ -87,6 +87,14 @@ export default createStyles((theme) => { fontSize: theme.fontSizes.sm, borderRadius: theme.radius.sm, backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.colors.gray[0], + + '& code': { + backgroundColor: 'transparent', + padding: 0, + borderRadius: 0, + color: 'inherit', + border: 0, + }, }, '& code': {