@@ -5,7 +5,8 @@ import { Link, useMatches, useParams } from '@tanstack/react-router'
55import { useLocalStorage } from '~/utils/useLocalStorage'
66import { last } from '~/utils/utils'
77import type { ConfigSchema , MenuItem } from '~/utils/config'
8- import { Framework , frameworkOptions } from '~/libraries'
8+ import { Framework } from '~/libraries'
9+ import { frameworkOptions } from '~/libraries/frameworks'
910import { DocsCalloutQueryGG } from '~/components/DocsCalloutQueryGG'
1011import { twMerge } from 'tailwind-merge'
1112import { partners , PartnerImage } from '~/utils/partners'
@@ -15,6 +16,15 @@ import { SearchButton } from './SearchButton'
1516import { FrameworkSelect , useCurrentFramework } from './FrameworkSelect'
1617import { VersionSelect } from './VersionSelect'
1718
19+ // Helper to get text color class from framework badge
20+ const getFrameworkTextColor = ( frameworkValue : string | undefined ) => {
21+ if ( ! frameworkValue ) return 'text-gray-500'
22+ const framework = frameworkOptions . find ( ( f ) => f . value === frameworkValue )
23+ if ( ! framework ) return 'text-gray-500'
24+ // Convert bg-* to text-* color class
25+ return framework . color . replace ( 'bg-' , 'text-' )
26+ }
27+
1828// Create context for width toggle state
1929const WidthToggleContext = React . createContext < {
2030 isFullWidth : boolean
@@ -247,11 +257,9 @@ export function DocsLayout({
247257 < div
248258 className = { `text-xs ${
249259 props . isActive ? 'opacity-100' : 'opacity-40'
250- } group-hover:opacity-100 font-bold transition-opacity ${
251- frameworkOptions . find (
252- ( f ) => f . value === child . badge
253- ) ?. fontColor ?? 'text-gray-500'
254- } `}
260+ } group-hover:opacity-100 font-bold transition-opacity ${ getFrameworkTextColor (
261+ child . badge
262+ ) } `}
255263 >
256264 { child . badge }
257265 </ div >
0 commit comments