From 2f18159ba0228a960cb4d25a19876804683f28ab Mon Sep 17 00:00:00 2001 From: avivkeller Date: Tue, 24 Jun 2025 13:02:41 -0400 Subject: [PATCH 1/2] fix(AlertBox): override code styles in a markdown context --- .../Common/AlertBox/index.module.css | 7 ++++++ .../Common/AlertBox/index.stories.tsx | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/ui-components/Common/AlertBox/index.module.css b/packages/ui-components/Common/AlertBox/index.module.css index 3c6cddc2bf0ed..227273b1b5f60 100644 --- a/packages/ui-components/Common/AlertBox/index.module.css +++ b/packages/ui-components/Common/AlertBox/index.module.css @@ -73,4 +73,11 @@ @apply bg-danger-700; } } + + code { + /* Ignore the styles from `markdown.css` */ + all: unset; + + @apply font-mono; + } } diff --git a/packages/ui-components/Common/AlertBox/index.stories.tsx b/packages/ui-components/Common/AlertBox/index.stories.tsx index d26a407bdacc3..d900597de6e2f 100644 --- a/packages/ui-components/Common/AlertBox/index.stories.tsx +++ b/packages/ui-components/Common/AlertBox/index.stories.tsx @@ -6,6 +6,12 @@ import AlertBox from '#ui/Common/AlertBox'; type Story = StoryObj; type Meta = MetaObj; +const withMain = (args: React.ComponentProps) => ( +
+ +
+); + export const Info: Story = { args: { level: 'info', @@ -46,6 +52,23 @@ export const Danger: Story = { }, }; +export const InMarkdown: Story = { + args: { + level: 'danger', + title: '0', + children: ( + <> + In a markdown component, Code renders correctly,{' '} + + even when in a link + + + ), + size: 'default', + }, + render: withMain, +}; + export const WithIcon: Story = { args: { level: 'info', From 1cf23534332b6ad1eed8ae67e606eaf7d0cb2e7f Mon Sep 17 00:00:00 2001 From: avivkeller Date: Tue, 24 Jun 2025 13:07:04 -0400 Subject: [PATCH 2/2] fixup! fix(AlertBox): override code styles in a markdown context --- packages/ui-components/Common/AlertBox/index.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui-components/Common/AlertBox/index.module.css b/packages/ui-components/Common/AlertBox/index.module.css index 227273b1b5f60..6aa272d8ff19b 100644 --- a/packages/ui-components/Common/AlertBox/index.module.css +++ b/packages/ui-components/Common/AlertBox/index.module.css @@ -78,6 +78,6 @@ /* Ignore the styles from `markdown.css` */ all: unset; - @apply font-mono; + @apply font-ibm-plex-mono; } }