Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 7cc44a8

Browse files
authored
Merge pull request #1326 from daslyfe/origin/jade/newthemes
feat: new themes + theme improvements
2 parents 90506f9 + c852b5f commit 7cc44a8

File tree

14 files changed

+154
-167
lines changed

14 files changed

+154
-167
lines changed

packages/codemirror/flash.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export const flashField = StateField.define({
1111
for (let e of tr.effects) {
1212
if (e.is(setFlash)) {
1313
if (e.value && tr.newDoc.length > 0) {
14-
const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } });
14+
const mark = Decoration.mark({
15+
attributes: { style: `background-color: rgba(255,255,255, .4); filter: invert(10%)` },
16+
});
1517
flash = Decoration.set([mark.range(0, tr.newDoc.length)]);
1618
} else {
1719
flash = Decoration.set([]);

packages/codemirror/themes.mjs

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import whitescreen, { settings as whitescreenSettings } from './themes/whitescre
55
import teletext, { settings as teletextSettings } from './themes/teletext.mjs';
66
import algoboy, { settings as algoboySettings } from './themes/algoboy.mjs';
77
import CutiePi, { settings as CutiePiSettings } from './themes/CutiePi.mjs';
8-
import terminal, { settings as terminalSettings } from './themes/terminal.mjs';
9-
import abcdef, { settings as abcdefSettings } from './themes/abcdef.mjs';
8+
import sonicPink, { settings as sonicPinkSettings } from './themes/sonic-pink.mjs';
9+
import redText, { settings as redTextSettings } from './themes/red-text.mjs';
10+
import greenText, { settings as greenTextSettings } from './themes/green-text.mjs';
1011
import androidstudio, { settings as androidstudioSettings } from './themes/androidstudio.mjs';
1112
import atomone, { settings as atomOneSettings } from './themes/atomone.mjs';
1213
import aura, { settings as auraSettings } from './themes/aura.mjs';
13-
import bespin, { settings as bespinSettings } from './themes/bespin.mjs';
1414
import darcula, { settings as darculaSettings } from './themes/darcula.mjs';
1515
import dracula, { settings as draculaSettings } from './themes/dracula.mjs';
1616
import duotoneDark, { settings as duotoneDarkSettings } from './themes/duotoneDark.mjs';
17-
import duotoneLight, { settings as duotoneLightSettings } from './themes/duotoneLight.mjs';
1817
import eclipse, { settings as eclipseSettings } from './themes/eclipse.mjs';
1918
import githubDark, { settings as githubDarkSettings } from './themes/githubDark.mjs';
2019
import githubLight, { settings as githubLightSettings } from './themes/githubLight.mjs';
@@ -32,52 +31,47 @@ import tokyoNightStorm, { settings as tokyoNightStormSettings } from './themes/t
3231
import tokyoNightDay, { settings as tokyoNightDaySettings } from './themes/tokyoNightDay.mjs';
3332
import vscodeDark, { settings as vscodeDarkSettings } from './themes/vscodeDark.mjs';
3433
import vscodeLight, { settings as vscodeLightSettings } from './themes/vscodeLight.mjs';
35-
// import xcodeDark, { settings as xcodeDarkSettings } from './themes/xcodeDark.mjs';
3634
import xcodeLight, { settings as xcodeLightSettings } from './themes/xcodeLight.mjs';
3735
import bbedit, { settings as bbeditSettings } from './themes/bbedit.mjs';
3836
import noctisLilac, { settings as noctisLilacSettings } from './themes/noctisLilac.mjs';
3937

4038
import { setTheme } from '@strudel/draw';
41-
4239
export const themes = {
4340
strudelTheme,
44-
bluescreen,
45-
blackscreen,
46-
whitescreen,
47-
teletext,
4841
algoboy,
42+
androidstudio,
4943
atomone,
5044
aura,
45+
bbedit,
46+
blackscreen,
47+
bluescreen,
48+
CutiePi,
5149
darcula,
5250
dracula,
53-
// todo: optimize
54-
// bespin,
55-
//abcdef,
56-
androidstudio,
5751
duotoneDark,
52+
eclipse,
5853
githubDark,
59-
CutiePi,
54+
githubLight,
55+
greenText,
6056
gruvboxDark,
57+
gruvboxLight,
58+
sonicPink,
6159
materialDark,
62-
nord,
60+
materialLight,
6361
monokai,
62+
noctisLilac,
63+
nord,
64+
redText,
6465
solarizedDark,
66+
solarizedLight,
6567
sublime,
68+
teletext,
6669
tokyoNight,
70+
tokyoNightDay,
6771
tokyoNightStorm,
6872
vscodeDark,
69-
//xcodeDark,
70-
// LIGHT
71-
bbedit,
72-
//duotoneLight,
73-
eclipse,
74-
githubLight,
75-
gruvboxLight,
76-
materialLight,
7773
vscodeLight,
78-
noctisLilac,
79-
solarizedLight,
80-
tokyoNightDay,
74+
whitescreen,
8175
xcodeLight,
8276
};
8377

@@ -88,28 +82,27 @@ export const settings = {
8882
whitescreen: whitescreenSettings,
8983
teletext: teletextSettings,
9084
algoboy: algoboySettings,
91-
terminal: terminalSettings,
92-
abcdef: abcdefSettings,
9385
androidstudio: androidstudioSettings,
9486
atomone: atomOneSettings,
9587
aura: auraSettings,
9688
bbedit: bbeditSettings,
97-
bespin: bespinSettings,
9889
darcula: darculaSettings,
9990
dracula: draculaSettings,
100-
duotoneLight: duotoneLightSettings,
10191
duotoneDark: duotoneDarkSettings,
10292
eclipse: eclipseSettings,
10393
CutiePi: CutiePiSettings,
94+
sonicPink: sonicPinkSettings,
10495
githubLight: githubLightSettings,
10596
githubDark: githubDarkSettings,
97+
greenText: greenTextSettings,
10698
gruvboxDark: gruvboxDarkSettings,
10799
gruvboxLight: gruvboxLightSettings,
108100
materialDark: materialDarkSettings,
109101
materialLight: materialLightSettings,
110102
noctisLilac: noctisLilacSettings,
111103
nord: nordSettings,
112104
monokai: monokaiSettings,
105+
redText: redTextSettings,
113106
solarizedLight: solarizedLightSettings,
114107
solarizedDark: solarizedDarkSettings,
115108
sublime: sublimeSettings,
@@ -118,7 +111,6 @@ export const settings = {
118111
vscodeDark: vscodeDarkSettings,
119112
vscodeLight: vscodeLightSettings,
120113
xcodeLight: xcodeLightSettings,
121-
//xcodeDark: xcodeDarkSettings,
122114
tokyoNightDay: tokyoNightDaySettings,
123115
};
124116

packages/codemirror/themes/abcdef.mjs

Lines changed: 0 additions & 55 deletions
This file was deleted.

packages/codemirror/themes/algoboy.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default createTheme({
5454
tag: [t.keyword, t.tagName, t.arithmeticOperator],
5555
color: palette[1],
5656
},
57+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: palette[0] },
5758
{ tag: [t.function(t.variableName), t.propertyName], color: palette[0] },
5859
{ tag: t.atom, color: palette[1] },
5960
],

packages/codemirror/themes/atomone.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ export default createTheme({
3838
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
3939
color: 'hsl(207, 82%, 66%)',
4040
},
41+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: 'hsl( 29, 54%, 61%)' },
4142
{ tag: [t.tagName, t.heading], color: '#e06c75' },
4243
{ tag: t.comment, color: '#54636D' },
4344
{ tag: [t.variableName, t.propertyName, t.labelName], color: 'hsl(220, 14%, 71%)' },
4445
{ tag: [t.attributeName, t.number], color: 'hsl( 29, 54%, 61%)' },
4546
{ tag: t.className, color: 'hsl( 39, 67%, 69%)' },
4647
{ tag: t.keyword, color: 'hsl(286, 60%, 67%)' },
48+
4749
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: '#98c379' },
4850
],
4951
});

packages/codemirror/themes/bespin.mjs

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @name Atom One
3+
* Atom One dark syntax theme
4+
*
5+
* https://github.com/atom/one-dark-syntax
6+
*/
7+
import { tags as t } from '@lezer/highlight';
8+
import { createTheme } from './theme-helper.mjs';
9+
10+
const hex = ['#000000', '#8ed675', '#56bd2a', '#54636D', '#171717'];
11+
12+
export const settings = {
13+
background: hex[0],
14+
lineBackground: 'transparent',
15+
foreground: hex[2],
16+
selection: hex[4],
17+
selectionMatch: hex[0],
18+
gutterBackground: hex[0],
19+
gutterForeground: hex[3],
20+
gutterBorder: 'transparent',
21+
lineHighlight: hex[0],
22+
};
23+
24+
export default createTheme({
25+
theme: 'dark',
26+
settings,
27+
styles: [
28+
{
29+
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
30+
color: hex[2],
31+
},
32+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[1] },
33+
{ tag: t.comment, color: hex[3] },
34+
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[2] },
35+
{ tag: [t.attributeName, t.number], color: hex[1] },
36+
{ tag: t.keyword, color: hex[2] },
37+
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[1] },
38+
],
39+
});
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @name Atom One
3+
* Atom One dark syntax theme
4+
*
5+
* https://github.com/atom/one-dark-syntax
6+
*/
7+
import { tags as t } from '@lezer/highlight';
8+
import { createTheme } from './theme-helper.mjs';
9+
10+
const hex = ['#000000', '#ff5356', '#bd312a', '#54636D', '#171717'];
11+
12+
export const settings = {
13+
background: hex[0],
14+
lineBackground: 'transparent',
15+
foreground: hex[2],
16+
selection: hex[4],
17+
selectionMatch: hex[0],
18+
gutterBackground: hex[0],
19+
gutterForeground: hex[3],
20+
gutterBorder: 'transparent',
21+
lineHighlight: hex[0],
22+
};
23+
24+
export default createTheme({
25+
theme: 'dark',
26+
settings,
27+
styles: [
28+
{
29+
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
30+
color: hex[2],
31+
},
32+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[1] },
33+
{ tag: t.comment, color: hex[3] },
34+
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[2] },
35+
{ tag: [t.attributeName, t.number], color: hex[1] },
36+
{ tag: t.keyword, color: hex[2] },
37+
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[1] },
38+
],
39+
});
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @name Atom One
3+
* Atom One dark syntax theme
4+
*
5+
* https://github.com/atom/one-dark-syntax
6+
*/
7+
import { tags as t } from '@lezer/highlight';
8+
import { createTheme } from './theme-helper.mjs';
9+
10+
const hex = ['#1e1e1e', '#fbde2d', '#ff1493', '#4c83ff', '#ededed', '#cccccc', '#ffffff30', '#dc2f8c'];
11+
12+
export const settings = {
13+
background: '#000000',
14+
lineBackground: 'transparent',
15+
foreground: hex[4],
16+
selection: hex[6],
17+
gutterBackground: hex[0],
18+
gutterForeground: hex[5],
19+
gutterBorder: 'transparent',
20+
lineHighlight: hex[0],
21+
};
22+
23+
export default createTheme({
24+
theme: 'dark',
25+
settings,
26+
styles: [
27+
{
28+
tag: [t.function(t.variableName), t.function(t.propertyName), t.url, t.processingInstruction],
29+
color: hex[4],
30+
},
31+
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: hex[3] },
32+
33+
{ tag: t.comment, color: '#54636D' },
34+
{ tag: [t.variableName, t.propertyName, t.labelName], color: hex[4] },
35+
{ tag: [t.attributeName, t.number], color: hex[3] },
36+
{ tag: t.keyword, color: hex[1] },
37+
{ tag: [t.string, t.regexp, t.special(t.propertyName)], color: hex[2] },
38+
],
39+
});

0 commit comments

Comments
 (0)