cobalt.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Ref: https://github.com/vadimdemedes/thememirror/blob/94a6475a9113ec03d880fcb817aadcc5a16e82e4/source/themes/cobalt.ts
  2. import { tags as t } from '@lezer/highlight';
  3. import { createTheme } from '@uiw/codemirror-themes';
  4. // Author: Jacob Rus
  5. export const cobalt = createTheme({
  6. theme: 'dark',
  7. settings: {
  8. background: '#00254b',
  9. foreground: '#FFFFFF',
  10. caret: '#FFFFFF',
  11. selection: '#B36539BF',
  12. gutterBackground: '#00254b',
  13. gutterForeground: '#FFFFFF70',
  14. lineHighlight: '#00000059',
  15. },
  16. styles: [
  17. {
  18. tag: t.comment,
  19. color: '#0088FF',
  20. },
  21. {
  22. tag: t.string,
  23. color: '#3AD900',
  24. },
  25. {
  26. tag: t.regexp,
  27. color: '#80FFC2',
  28. },
  29. {
  30. tag: [t.number, t.bool, t.null],
  31. color: '#FF628C',
  32. },
  33. {
  34. tag: [t.definitionKeyword, t.modifier],
  35. color: '#FFEE80',
  36. },
  37. {
  38. tag: t.variableName,
  39. color: '#CCCCCC',
  40. },
  41. {
  42. tag: t.self,
  43. color: '#FF80E1',
  44. },
  45. {
  46. tag: [
  47. t.className,
  48. t.definition(t.propertyName),
  49. t.function(t.variableName),
  50. t.definition(t.typeName),
  51. t.labelName,
  52. ],
  53. color: '#FFDD00',
  54. },
  55. {
  56. tag: [t.keyword, t.operator],
  57. color: '#FF9D00',
  58. },
  59. {
  60. tag: [t.propertyName, t.typeName],
  61. color: '#80FFBB',
  62. },
  63. {
  64. tag: t.special(t.brace),
  65. color: '#EDEF7D',
  66. },
  67. {
  68. tag: t.attributeName,
  69. color: '#9EFFFF',
  70. },
  71. {
  72. tag: t.derefOperator,
  73. color: '#fff',
  74. },
  75. {
  76. tag: [t.url, t.escape],
  77. color: '#497DBA',
  78. },
  79. {
  80. tag: [t.brace, t.processingInstruction, t.inserted],
  81. color: '#7491B4',
  82. },
  83. ],
  84. });