mirror of
https://github.com/supabase/supabase.git
synced 2026-05-29 00:42:13 +08:00
Code block theme used Vitesse. Code block theme uses the custom Supabase 2 theme, which matches the UI library and design system sites.
31 lines
577 B
TypeScript
31 lines
577 B
TypeScript
import { type CSSProperties } from 'react'
|
|
|
|
/*
|
|
* As defined in @shikijs/core/dist/chunk-tokens.d.mts
|
|
*/
|
|
enum FontStyle {
|
|
NotSet = -1,
|
|
None = 0,
|
|
Italic = 1,
|
|
Bold = 2,
|
|
Underline = 4,
|
|
}
|
|
|
|
export function getFontStyle(styleFlags: number): CSSProperties {
|
|
let style: CSSProperties = null
|
|
|
|
if (styleFlags & FontStyle.Italic) {
|
|
;(style ??= {}).fontStyle = 'italic'
|
|
}
|
|
|
|
if (styleFlags & FontStyle.Bold) {
|
|
;(style ??= {}).fontWeight = 'bold'
|
|
}
|
|
|
|
if (styleFlags & FontStyle.Underline) {
|
|
;(style ??= {}).textDecoration = 'underline'
|
|
}
|
|
|
|
return style
|
|
}
|