11import { tags as t } from '@lezer/highlight' ;
2- import { createTheme , CreateThemeOptions } from '@uiw/codemirror-themes' ;
2+ import { createTheme , type CreateThemeOptions } from '@uiw/codemirror-themes' ;
33import { config as c } from './color' ;
44
55export const defaultSettingsAndromeda : CreateThemeOptions [ 'settings' ] = {
@@ -13,6 +13,34 @@ export const defaultSettingsAndromeda: CreateThemeOptions['settings'] = {
1313 lineHighlight : c . activeLine ,
1414} ;
1515
16+ export const andromedaDarkStyle : CreateThemeOptions [ 'styles' ] = [
17+ { tag : t . keyword , color : c . keyword } ,
18+ { tag : [ t . name , t . deleted , t . character , t . macroName ] , color : c . variable } ,
19+ { tag : [ t . propertyName ] , color : c . function } ,
20+ { tag : [ t . processingInstruction , t . string , t . inserted , t . special ( t . string ) ] , color : c . string } ,
21+ { tag : [ t . function ( t . variableName ) , t . labelName ] , color : c . function } ,
22+ { tag : [ t . color , t . constant ( t . name ) , t . standard ( t . name ) ] , color : c . constant } ,
23+ { tag : [ t . definition ( t . name ) , t . separator ] , color : c . variable } ,
24+ { tag : [ t . className ] , color : c . class } ,
25+ { tag : [ t . number , t . changed , t . annotation , t . modifier , t . self , t . namespace ] , color : c . number } ,
26+ { tag : [ t . typeName ] , color : c . type , fontStyle : c . type } ,
27+ { tag : [ t . operator ] , color : c . keyword } ,
28+ { tag : [ t . url , t . escape , t . regexp , t . link ] , color : c . regexp } ,
29+ { tag : [ t . meta , t . comment ] , color : c . comment } ,
30+ { tag : t . tagName , color : c . tag } ,
31+ { tag : t . strong , fontWeight : 'bold' } ,
32+ { tag : t . emphasis , fontStyle : 'italic' } ,
33+ { tag : t . link , textDecoration : 'underline' } ,
34+ { tag : t . heading , fontWeight : 'bold' , color : c . heading } ,
35+ { tag : [ t . atom , t . special ( t . variableName ) ] , color : c . variable } ,
36+ { tag : t . invalid , color : c . invalid } ,
37+ { tag : t . strikethrough , textDecoration : 'line-through' } ,
38+ {
39+ tag : [ t . operatorKeyword , t . bool , t . null , t . variableName ] ,
40+ color : c . constant ,
41+ } ,
42+ ] ;
43+
1644export const andromedaInit = ( options ?: Partial < CreateThemeOptions > ) => {
1745 const { theme = 'dark' , settings = { } , styles = [ ] } = options || { } ;
1846 return createTheme ( {
@@ -21,34 +49,7 @@ export const andromedaInit = (options?: Partial<CreateThemeOptions>) => {
2149 ...defaultSettingsAndromeda ,
2250 ...settings ,
2351 } ,
24- styles : [
25- { tag : t . keyword , color : c . keyword } ,
26- { tag : [ t . name , t . deleted , t . character , t . macroName ] , color : c . variable } ,
27- { tag : [ t . propertyName ] , color : c . function } ,
28- { tag : [ t . processingInstruction , t . string , t . inserted , t . special ( t . string ) ] , color : c . string } ,
29- { tag : [ t . function ( t . variableName ) , t . labelName ] , color : c . function } ,
30- { tag : [ t . color , t . constant ( t . name ) , t . standard ( t . name ) ] , color : c . constant } ,
31- { tag : [ t . definition ( t . name ) , t . separator ] , color : c . variable } ,
32- { tag : [ t . className ] , color : c . class } ,
33- { tag : [ t . number , t . changed , t . annotation , t . modifier , t . self , t . namespace ] , color : c . number } ,
34- { tag : [ t . typeName ] , color : c . type , fontStyle : c . type } ,
35- { tag : [ t . operator ] , color : c . keyword } ,
36- { tag : [ t . url , t . escape , t . regexp , t . link ] , color : c . regexp } ,
37- { tag : [ t . meta , t . comment ] , color : c . comment } ,
38- { tag : t . tagName , color : c . tag } ,
39- { tag : t . strong , fontWeight : 'bold' } ,
40- { tag : t . emphasis , fontStyle : 'italic' } ,
41- { tag : t . link , textDecoration : 'underline' } ,
42- { tag : t . heading , fontWeight : 'bold' , color : c . heading } ,
43- { tag : [ t . atom , t . special ( t . variableName ) ] , color : c . variable } ,
44- { tag : t . invalid , color : c . invalid } ,
45- { tag : t . strikethrough , textDecoration : 'line-through' } ,
46- {
47- tag : [ t . operatorKeyword , t . bool , t . null , t . variableName ] ,
48- color : c . constant ,
49- } ,
50- ...styles ,
51- ] ,
52+ styles : [ ...andromedaDarkStyle , ...styles ] ,
5253 } ) ;
5354} ;
5455
0 commit comments