| 121 | * page can't paint light-theme tokens and then snap once `useIsDark` syncs. |
| 122 | */ |
| 123 | export function resolveShikiThemes(theme?: ShikiThemeProp): { |
| 124 | light: SupportedTheme; |
| 125 | dark: SupportedTheme; |
| 126 | } { |
| 127 | if (typeof theme === "string") return { light: theme, dark: theme }; |
| 128 | return { |
| 129 | light: theme?.light ?? DEFAULT_LIGHT_THEME, |
| 130 | dark: theme?.dark ?? DEFAULT_DARK_THEME, |
| 131 | }; |
| 132 | } |
| 133 | |
| 134 | /** The shiki options that render dual-theme `light-dark(...)` colors. */ |
| 135 | export const dualThemeOptions = (theme?: ShikiThemeProp) => ({ |