diff --git a/src/components/Markdown.tsx b/src/components/Markdown.tsx index d247f38c4..614bc8083 100644 --- a/src/components/Markdown.tsx +++ b/src/components/Markdown.tsx @@ -194,7 +194,7 @@ export function CodeBlock({ return (
} - case 'alert': { - const variant = attributes.variant ?? 'note' - return ( - - {domToReact(domNode.children as any, options)} - - ) - } default: return
{domToReact(domNode.children as any, options)}
} diff --git a/src/components/Tabs.tsx b/src/components/Tabs.tsx index 133c44b38..97324586c 100644 --- a/src/components/Tabs.tsx +++ b/src/components/Tabs.tsx @@ -1,3 +1,4 @@ +import { getRouteApi } from '@tanstack/react-router' import * as React from 'react' import { getFrameworkOptions } from '~/libraries' @@ -13,12 +14,15 @@ export type TabsProps = { } export function Tabs({ tabs, children }: TabsProps) { + const Route = getRouteApi() + const { framework } = Route.useParams() + const [activeSlug, setActiveSlug] = React.useState( - () => tabs[0]?.slug ?? 'tab' + () => tabs.find((tab) => tab.slug === framework)?.slug || tabs[0].slug ) return ( -
+
{tabs.map((tab) => { return ( diff --git a/src/styles/app.css b/src/styles/app.css index a7ad2d0b8..de642d157 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -539,8 +539,16 @@ html.dark .shiki.tokyo-night span[style*='color: #51597D'] { } /* Markdown Alerts */ + +.not-prose .markdown-alert { + @apply pt-2 pb-4 px-3 flex flex-col gap-2; + p { + @apply my-2; + } +} + .markdown-alert { - @apply border-l-4 pl-4 py-1.5 my-2 dark:bg-gray-900 rounded-r-sm; + @apply border-l-4 pl-4 py-1.5 my-2 bg-white dark:bg-gray-900 rounded-r-sm; } .markdown-alert > * { @@ -588,13 +596,33 @@ html.dark .shiki.tokyo-night span[style*='color: #51597D'] { } .markdown-alert .markdown-alert-title { - @apply flex justify-start items-center font-medium mb-1.5; + @apply flex justify-start items-center font-medium; } .bg-clip-text { @apply print:text-gray-800; } +[data-tab] { + @apply text-sm leading-normal; +} + +[data-tab] a { + @apply underline font-[500]; +} + +[data-tab] .markdown-alert { + @apply bg-gray-100 dark:bg-gray-900; +} + +[data-tab] > .codeblock:not(:only-child) pre { + @apply dark:bg-white/5! bg-black/5!; +} + +[data-tab] > .markdown-alert [aria-label] svg { + @apply stroke-current fill-current; +} + mark { @apply bg-yellow-400 rounded-md px-px mx-px; }