Skip to content

Commit

Permalink
feat(theme): add tomorrow-night-blue theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 26, 2023
1 parent 934cb75 commit 6a2bf01
Show file tree
Hide file tree
Showing 28 changed files with 719 additions and 242 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 @uiw/codemirror-theme-tomorrow-night-blue publish to NPM
run: npm publish --access public
working-directory: ./themes/tomorrow-night-blue/
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 @uiw/codemirror-theme-vscode publish to NPM
run: npm publish --access public
working-directory: ./themes/vscode/
Expand Down
67 changes: 34 additions & 33 deletions core/README.md

Large diffs are not rendered by default.

290 changes: 290 additions & 0 deletions themes/_scripts/data/tomorrow-night-blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
{
"type": "dark",
"colors": {
"focusBorder": "#bbdaff",
"errorForeground": "#a92049",
"input.background": "#001733",
"dropdown.background": "#001733",
"quickInputList.focusBackground": "#ffffff60",
"list.activeSelectionBackground": "#ffffff60",
"list.inactiveSelectionBackground": "#ffffff40",
"list.hoverBackground": "#ffffff30",
"list.highlightForeground": "#bbdaff",
"pickerGroup.foreground": "#bbdaff",
"editor.background": "#002451",
"editor.foreground": "#ffffff",
"editor.selectionBackground": "#003f8e",
"minimap.selectionHighlight": "#003f8e",
"editor.lineHighlightBackground": "#00346e",
"editorLineNumber.activeForeground": "#949494",
"editorCursor.foreground": "#ffffff",
"editorWhitespace.foreground": "#404f7d",
"editorWidget.background": "#001c40",
"editorHoverWidget.background": "#001c40",
"editorHoverWidget.border": "#ffffff44",
"editorGroup.border": "#404f7d",
"editorGroupHeader.tabsBackground": "#001733",
"editorGroup.dropBackground": "#25375daa",
"peekViewResult.background": "#001c40",
"tab.inactiveBackground": "#001c40",
"tab.lastPinnedBorder": "#007acc80",
"debugToolBar.background": "#001c40",
"titleBar.activeBackground": "#001126",
"statusBar.background": "#001126",
"statusBarItem.remoteBackground": "#0e639c",
"ports.iconRunningProcessForeground": "#bbdaff",
"statusBar.noFolderBackground": "#001126",
"statusBar.debuggingBackground": "#001126",
"activityBar.background": "#001733",
"activityBarItem.profilesBackground": "#003271",
"progressBar.background": "#bbdaffcc",
"badge.background": "#bbdaffcc",
"badge.foreground": "#001733",
"sideBar.background": "#001c40",
"terminal.ansiBlack": "#111111",
"terminal.ansiRed": "#ff9da4",
"terminal.ansiGreen": "#d1f1a9",
"terminal.ansiYellow": "#ffeead",
"terminal.ansiBlue": "#bbdaff",
"terminal.ansiMagenta": "#ebbbff",
"terminal.ansiCyan": "#99ffff",
"terminal.ansiWhite": "#cccccc",
"terminal.ansiBrightBlack": "#333333",
"terminal.ansiBrightRed": "#ff7882",
"terminal.ansiBrightGreen": "#b8f171",
"terminal.ansiBrightYellow": "#ffe580",
"terminal.ansiBrightBlue": "#80baff",
"terminal.ansiBrightMagenta": "#d778ff",
"terminal.ansiBrightCyan": "#78ffff",
"terminal.ansiBrightWhite": "#ffffff"
},
"tokenColors": [
{
"settings": {
"background": "#002451",
"foreground": "#FFFFFF"
}
},
{
"scope": [
"meta.embedded",
"source.groovy.embedded",
"meta.jsx.children",
"string meta.image.inline.markdown",
"variable.legacy.builtin.python"
],
"settings": {
"foreground": "#FFFFFF"
}
},
{
"name": "Comment",
"scope": "comment",
"settings": {
"foreground": "#7285B7"
}
},
{
"name": "Foreground, Operator",
"scope": "keyword.operator.class, keyword.operator, constant.other, source.php.embedded.line",
"settings": {
"fontStyle": "",
"foreground": "#FFFFFF"
}
},
{
"name": "Variable, String Link, Regular Expression, Tag Name, GitGutter deleted",
"scope": "variable, support.other.variable, string.other.link, string.regexp, entity.name.tag, entity.other.attribute-name, meta.tag, declaration.tag, markup.deleted.git_gutter",
"settings": {
"foreground": "#FF9DA4"
}
},
{
"name": "Number, Constant, Function Argument, Tag Attribute, Embedded",
"scope": "constant.numeric, constant.language, support.constant, constant.character, variable.parameter, punctuation.section.embedded, keyword.other.unit",
"settings": {
"fontStyle": "",
"foreground": "#FFC58F"
}
},
{
"name": "Class, Support",
"scope": "entity.name.class, entity.name.type, entity.name.namespace, entity.name.scope-resolution, support.type, support.class",
"settings": {
"fontStyle": "",
"foreground": "#FFEEAD"
}
},
{
"name": "String, Symbols, Inherited Class, Markup Heading, GitGutter inserted",
"scope": "string, constant.other.symbol, entity.other.inherited-class, markup.heading, markup.inserted.git_gutter",
"settings": {
"fontStyle": "",
"foreground": "#D1F1A9"
}
},
{
"name": "Operator, Misc",
"scope": "keyword.operator, constant.other.color",
"settings": {
"foreground": "#99FFFF"
}
},
{
"name": "Function, Special Method, Block Level, GitGutter changed",
"scope": "entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.block-level, markup.changed.git_gutter",
"settings": {
"fontStyle": "",
"foreground": "#BBDAFF"
}
},
{
"name": "Keyword, Storage",
"scope": "keyword, storage, storage.type, entity.name.tag.css",
"settings": {
"fontStyle": "",
"foreground": "#EBBBFF"
}
},
{
"name": "Invalid",
"scope": "invalid",
"settings": {
"fontStyle": "",
"foreground": "#a92049"
}
},
{
"name": "Separator",
"scope": "meta.separator",
"settings": {
"foreground": "#FFFFFF"
}
},
{
"name": "Deprecated",
"scope": "invalid.deprecated",
"settings": {
"fontStyle": "",
"foreground": "#cd9731"
}
},
{
"name": "Diff foreground",
"scope": "markup.inserted.diff, markup.deleted.diff, meta.diff.header.to-file, meta.diff.header.from-file",
"settings": {
"foreground": "#FFFFFF"
}
},
{
"name": "Diff insertion",
"scope": "markup.inserted.diff, meta.diff.header.to-file",
"settings": {
"foreground": "#718c00"
}
},
{
"name": "Diff deletion",
"scope": "markup.deleted.diff, meta.diff.header.from-file",
"settings": {
"foreground": "#c82829"
}
},
{
"name": "Diff header",
"scope": "meta.diff.header.from-file, meta.diff.header.to-file",
"settings": {
"foreground": "#4271ae"
}
},
{
"name": "Diff range",
"scope": "meta.diff.range",
"settings": {
"fontStyle": "italic",
"foreground": "#3e999f"
}
},
{
"name": "Markup Quote",
"scope": "markup.quote",
"settings": {
"foreground": "#FFC58F"
}
},
{
"name": "Markup Lists",
"scope": "markup.list",
"settings": {
"foreground": "#BBDAFF"
}
},
{
"name": "Markup Styling",
"scope": "markup.bold, markup.italic",
"settings": {
"foreground": "#FFC58F"
}
},
{
"name": "Markup: Strong",
"scope": "markup.bold",
"settings": {
"fontStyle": "bold"
}
},
{
"name": "Markup: Emphasis",
"scope": "markup.italic",
"settings": {
"fontStyle": "italic"
}
},
{
"scope": "markup.strikethrough",
"settings": {
"fontStyle": "strikethrough"
}
},
{
"name": "Markup Inline",
"scope": "markup.inline.raw",
"settings": {
"fontStyle": "",
"foreground": "#FF9DA4"
}
},
{
"name": "Markup Headings",
"scope": "markup.heading",
"settings": {
"fontStyle": "bold"
}
},
{
"scope": "token.info-token",
"settings": {
"foreground": "#6796e6"
}
},
{
"scope": "token.warn-token",
"settings": {
"foreground": "#cd9731"
}
},
{
"scope": "token.error-token",
"settings": {
"foreground": "#f44747"
}
},
{
"scope": "token.debug-token",
"settings": {
"foreground": "#b267e6"
}
}
],
"semanticHighlighting": true
}
22 changes: 20 additions & 2 deletions themes/_scripts/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import FS from 'node:fs/promises';
const require = createRequire(import.meta.url);

const includes = (data, ...arg) => {
const scope = typeof data.scope === 'string' ? data.scope.split(' ').filter(Boolean) : data.scope || [];
const isComma = typeof data.scope === 'string' && data.scope.includes(',');
const scope = typeof data.scope === 'string' ? data.scope.split(isComma ? ',' : ' ').filter(Boolean).map(t => t.trim()) : data.scope || [];
const isInclude = !![scope||[]].flat().find(elm => arg.includes(elm));
return isInclude ? getForeground(data.settings.foreground) : undefined;
}
Expand All @@ -17,7 +18,8 @@ function format(data = {}, dark = false) {
// Layout
background: colors['editor.background'],
foreground: colors['editor.foreground'] || colors['input.foreground'],
selection: colors['editor.selectionBackground'],
selection: colors['editor.wordHighlightBackground'] || colors['editor.selectionBackground'],
selectionMatch: colors['editor.wordHighlightStrongBackground'] || colors['editor.selectionBackground'],
cursor: colors['editorCursor.foreground'] || colors['foreground'],
dropdownBackground: colors['dropdown.background'],
dropdownBorder: colors['dropdown.border'] || colors['foreground'],
Expand Down Expand Up @@ -127,6 +129,22 @@ const getString = (obj) => `export const config = ${JSON.stringify(obj, null, 2)
themePath = '../monokai-dimmed/src/color.ts';
await FS.writeFile(themePath, getString(monokaiDimmed));
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);

const solarizedDark = format(require('./data/solarized.dark.json'));
themePath = '../solarized/src/dark-color.ts';
await FS.writeFile(themePath, getString(solarizedDark));
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);

const solarizedLight = format(require('./data/solarized.light.json'));
themePath = '../solarized/src/light-color.ts';
await FS.writeFile(themePath, getString(solarizedLight));
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);

const tomorrowNightBlue = format(require('./data/tomorrow-night-blue.json'));
themePath = '../tomorrow-night-blue/src/color.ts';
await FS.writeFile(themePath, getString(tomorrowNightBlue));
console.log(`🎉 File \x1b[32;1m${themePath}\x1b[0m created.`);

// const themeSolarizedDark = format(require('./data/solarized.dark.json'), true)
// console.log('~~~::', themeSolarizedDark);
// const themeSolarizedLight = format(require('./data/solarized.light.json'))
Expand Down
1 change: 1 addition & 0 deletions themes/abyss/src/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const config = {
background: '#000c18',
foreground: '#6688cc',
selection: '#770811',
selectionMatch: '#770811',
cursor: '#ddbb88',
dropdownBackground: '#181f2f',
activeLine: '#082050',
Expand Down
2 changes: 1 addition & 1 deletion themes/abyss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const defaultSettingsAbyss: CreateThemeOptions['settings'] = {
foreground: config.foreground,
caret: config.cursor,
selection: config.selection,
selectionMatch: config.selection,
selectionMatch: config.selectionMatch,
gutterBackground: config.background,
gutterForeground: config.foreground,
lineHighlight: config.activeLine,
Expand Down
6 changes: 6 additions & 0 deletions themes/all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ export * from '@uiw/codemirror-theme-xcode';
<img width="436" alt="codemirror-theme-tokyo-night-storm" src="https://user-images.githubusercontent.com/1680273/206097179-8a490b97-87da-4285-a9bc-b0c9f510e7ed.png">
</a>

### tomorrow-night-blue

<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/tomorrow-night-blue">
<img width="436" alt="codemirror-theme-tomorrow-night-blue" src="https://github.com/uiwjs/react-codemirror/assets/1680273/dcc31c7a-70d7-4c4d-bf9f-a7e8212030d8">
</a>

### vscode

<a href="https://uiwjs.github.io/react-codemirror/#/theme/data/vscode/dark">
Expand Down
1 change: 1 addition & 0 deletions themes/all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@uiw/codemirror-theme-tokyo-night": "4.21.10",
"@uiw/codemirror-theme-tokyo-night-day": "4.21.10",
"@uiw/codemirror-theme-tokyo-night-storm": "4.21.10",
"@uiw/codemirror-theme-tomorrow-night-blue": "4.21.10",
"@uiw/codemirror-theme-vscode": "4.21.10",
"@uiw/codemirror-theme-xcode": "4.21.10",
"@uiw/codemirror-themes": "4.21.10"
Expand Down
1 change: 1 addition & 0 deletions themes/all/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ export * from '@uiw/codemirror-theme-sublime';
export * from '@uiw/codemirror-theme-tokyo-night';
export * from '@uiw/codemirror-theme-tokyo-night-storm';
export * from '@uiw/codemirror-theme-tokyo-night-day';
export * from '@uiw/codemirror-theme-tomorrow-night-blue';
export * from '@uiw/codemirror-theme-vscode';
export * from '@uiw/codemirror-theme-xcode';
Loading

0 comments on commit 6a2bf01

Please sign in to comment.