File tree Expand file tree Collapse file tree 3 files changed +37
-13
lines changed
Expand file tree Collapse file tree 3 files changed +37
-13
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ export function CodeBlock({
194194 return (
195195 < div
196196 className = { twMerge (
197- 'w-full max-w-full relative not-prose border border-gray-500/20 rounded-md [&_pre]:rounded-md [*[data-tab]_&]:only:border-0' ,
197+ 'codeblock w-full max-w-full relative not-prose border border-gray-500/20 rounded-md [&_pre]:rounded-md [*[data-tab]_&]:only:border-0' ,
198198 props . className
199199 ) }
200200 style = { props . style }
@@ -312,14 +312,6 @@ const options: HTMLReactParserOptions = {
312312
313313 return < Tabs tabs = { tabs } children = { children as any } />
314314 }
315- case 'alert' : {
316- const variant = attributes . variant ?? 'note'
317- return (
318- < Alert variant = { variant } >
319- { domToReact ( domNode . children as any , options ) }
320- </ Alert >
321- )
322- }
323315 default :
324316 return < div > { domToReact ( domNode . children as any , options ) } </ div >
325317 }
Original file line number Diff line number Diff line change 1+ import { getRouteApi } from '@tanstack/react-router'
12import * as React from 'react'
23import { getFrameworkOptions } from '~/libraries'
34
@@ -13,12 +14,15 @@ export type TabsProps = {
1314}
1415
1516export function Tabs ( { tabs, children } : TabsProps ) {
17+ const Route = getRouteApi ( )
18+ const { framework } = Route . useParams ( )
19+
1620 const [ activeSlug , setActiveSlug ] = React . useState (
17- ( ) => tabs [ 0 ] ?. slug ?? 'tab'
21+ ( ) => tabs . find ( ( tab ) => tab . slug === framework ) ?. slug || tabs [ 0 ] . slug
1822 )
1923
2024 return (
21- < div className = "not-prose" >
25+ < div className = "not-prose my-4 " >
2226 < div className = "flex items-center justify-start gap-2 rounded-t-md border-b border-gray-200 dark:border-gray-700 overflow-x-auto scrollbar-hide bg-white dark:bg-[#1a1b26]" >
2327 { tabs . map ( ( tab ) => {
2428 return (
Original file line number Diff line number Diff line change @@ -539,8 +539,16 @@ html.dark .shiki.tokyo-night span[style*='color: #51597D'] {
539539}
540540
541541/* Markdown Alerts */
542+
543+ .not-prose .markdown-alert {
544+ @apply pt-2 pb-4 px-3 flex flex-col gap-2;
545+ p {
546+ @apply my-2;
547+ }
548+ }
549+
542550.markdown-alert {
543- @apply border-l-4 pl-4 py-1.5 my-2 dark:bg-gray-900 rounded-r-sm;
551+ @apply border-l-4 pl-4 py-1.5 my-2 bg-white dark:bg-gray-900 rounded-r-sm;
544552}
545553
546554.markdown-alert > * {
@@ -588,13 +596,33 @@ html.dark .shiki.tokyo-night span[style*='color: #51597D'] {
588596}
589597
590598.markdown-alert .markdown-alert-title {
591- @apply flex justify-start items-center font-medium mb-1.5 ;
599+ @apply flex justify-start items-center font-medium;
592600}
593601
594602.bg-clip-text {
595603 @apply print:text-gray-800;
596604}
597605
606+ [data-tab ] {
607+ @apply text-sm leading-normal;
608+ }
609+
610+ [data-tab ] a {
611+ @apply underline font-[500 ];
612+ }
613+
614+ [data-tab ] .markdown-alert {
615+ @apply bg-gray-100 dark:bg-gray-900;
616+ }
617+
618+ [data-tab ] > .codeblock : not (: only-child ) pre {
619+ @apply dark:bg-white/5! bg-black/5!;
620+ }
621+
622+ [data-tab ] > .markdown-alert [aria-label ] svg {
623+ @apply stroke-current fill-current;
624+ }
625+
598626mark {
599627 @apply bg-yellow-400 rounded-md px-px mx-px;
600628}
You can’t perform that action at this time.
0 commit comments