diff --git a/docs-ui/src/components/Theming/index.tsx b/docs-ui/src/components/Theming/index.tsx index f47e86306a..9f67c3a111 100644 --- a/docs-ui/src/components/Theming/index.tsx +++ b/docs-ui/src/components/Theming/index.tsx @@ -38,12 +38,12 @@ export function Theming({ definition }: ThemingProps) { ...Object.values(classNames).slice(1), ]; - // Use the same styled components from MDX - const H2 = formattedMDXComponents.h2!; - const P = formattedMDXComponents.p!; - const Ul = formattedMDXComponents.ul!; - const Li = formattedMDXComponents.li!; - const Code = formattedMDXComponents.code!; + // Use the same styled components from MDX, with fallbacks to HTML elements + const H2 = formattedMDXComponents.h2 || 'h2'; + const P = formattedMDXComponents.p || 'p'; + const Ul = formattedMDXComponents.ul || 'ul'; + const Li = formattedMDXComponents.li || 'li'; + const Code = formattedMDXComponents.code || 'code'; return (
diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 76496f8a86..80c42db125 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -532,7 +532,7 @@ **Affected components:** VisuallyHidden -- 00bfb83: Fix default font wight and font family in Backstage UI. +- 00bfb83: Fix default font weight and font family in Backstage UI. ## 0.9.0-next.3