mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 14:00:05 +02:00

[web] Add new system theme to the editor GitOrigin-RevId: b65083c5e96abc493556e901c861689cb7e3bbf7
29 lines
744 B
TypeScript
29 lines
744 B
TypeScript
export type OverallTheme = '' | 'light-' | 'system'
|
|
|
|
export const fontFamilies = {
|
|
monaco: ['Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'monospace'],
|
|
lucida: ['Lucida Console', 'Source Code Pro', 'monospace'],
|
|
opendyslexicmono: ['OpenDyslexic Mono', 'monospace'],
|
|
}
|
|
|
|
export type FontFamily = keyof typeof fontFamilies
|
|
|
|
export const lineHeights = {
|
|
compact: 1.33,
|
|
normal: 1.6,
|
|
wide: 2,
|
|
}
|
|
|
|
export type LineHeight = keyof typeof lineHeights
|
|
|
|
type Options = {
|
|
fontFamily: FontFamily
|
|
fontSize: number
|
|
lineHeight: LineHeight
|
|
}
|
|
|
|
export const userStyles = ({ fontFamily, fontSize, lineHeight }: Options) => ({
|
|
fontFamily: fontFamilies[fontFamily]?.join(','),
|
|
fontSize: `${fontSize}px`,
|
|
lineHeight: lineHeights[lineHeight],
|
|
})
|