UNPKG

@uiw/codemirror-theme-androidstudio

Version:
41 lines (36 loc) 1.37 kB
/** * @name androidstudio */ import { tags as t } from '@lezer/highlight'; import { createTheme, type CreateThemeOptions } from '@uiw/codemirror-themes'; export const defaultSettingsAndroidstudio: CreateThemeOptions['settings'] = { background: '#282b2e', foreground: '#a9b7c6', caret: '#00FF00', selection: '#4e5254', selectionMatch: '#4e5254', lineHighlight: '#7f85891f', }; export const androidstudioDarkStyle: CreateThemeOptions['styles'] = [ { tag: [t.keyword, t.deleted, t.className], color: '#cc7832' }, { tag: [t.number, t.literal, t.derefOperator], color: '#6897bb' }, { tag: [t.link, t.variableName], color: '#629755' }, { tag: [t.comment, t.quote], color: 'grey' }, { tag: [t.meta, t.documentMeta], color: '#bbb529' }, { tag: [t.string, t.propertyName, t.attributeValue], color: '#6a8759' }, { tag: [t.heading, t.typeName], color: '#ffc66d' }, { tag: [t.attributeName], color: '#a9b7c6' }, { tag: [t.emphasis], fontStyle: 'italic' }, ]; export const androidstudioInit = (options?: Partial<CreateThemeOptions>) => { const { theme = 'dark', settings = {}, styles = [] } = options || {}; return createTheme({ theme: theme, settings: { ...defaultSettingsAndroidstudio, ...settings, }, styles: [...androidstudioDarkStyle, ...styles], }); }; export const androidstudio = androidstudioInit();