Skip to content

Commit

Permalink
add flow and type for palette
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseadamsio committed May 18, 2019
1 parent 8432751 commit 61dab54
Show file tree
Hide file tree
Showing 45 changed files with 645 additions and 347 deletions.
11 changes: 11 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]

[include]

[libs]

[lints]

[options]

[strict]
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
"scripts": {
"build": "node src/index.js",
"cp:static": "cp LICENSE themes && cp src/favicon-128.png themes/icon.png",
"develop:init": "(test -L $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night || ln -s $PWD/themes $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night) && yarn build",
"test:flow": "flow check",
"vscode:prepublish": "yarn build && yarn cp:static",
"vscode:publish": "cd themes && vsce",
"develop:init": "(test -L $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night || ln -s $PWD/themes $HOME/.vscode/extensions/chaseadamsio.vscode-theme-neon-night) && yarn build"
"vscode:publish": "cd themes && vsce"
},
"dependencies": {
"flow-bin": "^0.98.1"
}
}
18 changes: 12 additions & 6 deletions src/colors/activity-bar.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#activity-bar
const activityBar = colors => ({
"activityBar.background": colors.black,
"activityBarBadge.background": colors.white,
"activityBarBadge.foreground": colors.black,
"activityBar.foreground": colors.magenta,
"activityBar.inactiveForeground": colors.white77
const activityBar = (palette /*: Palette */) => ({
"activityBar.background": palette.black,
"activityBarBadge.background": palette.white,
"activityBarBadge.foreground": palette.black,
"activityBar.foreground": palette.magenta,
"activityBar.inactiveForeground": palette.white77
});

module.exports = activityBar;
12 changes: 9 additions & 3 deletions src/colors/badge.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#badge
const badge = colors => ({
"badge.foreground": colors.magenta,
"badge.background": colors.black
const badge = (palette /*: Palette */) => ({
"badge.foreground": palette.magenta,
"badge.background": palette.black
});

module.exports = badge;
20 changes: 13 additions & 7 deletions src/colors/base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#base-colors
const baseColors = colors => ({
foreground: colors.white,
focusBorder: colors.magenta77,
"widget.shadow": colors.black,
"selection.background": colors.magenta33,
descriptionForeground: colors.white,
errorForeground: colors.red
const baseColors = (palette /*: Palette */) => ({
foreground: palette.white,
focusBorder: palette.magenta77,
"widget.shadow": palette.black,
"selection.background": palette.magenta33,
descriptionForeground: palette.white,
errorForeground: palette.red
});

module.exports = baseColors;
18 changes: 12 additions & 6 deletions src/colors/breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#breadcrumbs
const breadcrumbs = colors => ({
"breadcrumb.foreground": colors.white,
"breadcrumb.background": colors.black,
"breadcrumbPicker.background": colors.black,
"breadcrumb.focusForeground": colors.magenta,
"breadcrumb.activeSelectionForeground": colors.magenta
const breadcrumbs = (palette /*: Palette */) => ({
"breadcrumb.foreground": palette.white,
"breadcrumb.background": palette.black,
"breadcrumbPicker.background": palette.black,
"breadcrumb.focusForeground": palette.magenta,
"breadcrumb.activeSelectionForeground": palette.magenta
});

module.exports = breadcrumbs;
14 changes: 10 additions & 4 deletions src/colors/button.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#button-control
const buttonColors = colors => ({
"button.background": colors.blue,
"button.hoverBackground": colors.cyan,
"button.foreground": colors.black
const buttonColors = (palette /*: Palette */) => ({
"button.background": palette.blue,
"button.hoverBackground": palette.cyan,
"button.foreground": palette.black
});

module.exports = buttonColors;
12 changes: 9 additions & 3 deletions src/colors/debug.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#debug
const debug = colors => ({
"debugToolBar.background": colors.blackout,
"debugToolBar.border": colors.magenta
const debug = (palette /*: Palette */) => ({
"debugToolBar.background": palette.blackout,
"debugToolBar.border": palette.magenta
});

module.exports = debug;
14 changes: 10 additions & 4 deletions src/colors/diff-editor.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#diff-editor-colors
const diffEditor = colors => ({
"diffEditor.insertedTextBackground": `${colors.green}11`,
"diffEditor.removedTextBackground": `${colors.red}11`,
"diffEditor.border": colors.magenta77
const diffEditor = (palette /*: Palette */) => ({
"diffEditor.insertedTextBackground": `${palette.green}11`,
"diffEditor.removedTextBackground": `${palette.red}11`,
"diffEditor.border": palette.magenta77
});

module.exports = diffEditor;
16 changes: 11 additions & 5 deletions src/colors/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#dropdown-control
const dropdown = colors => ({
"dropdown.background": colors.blackout,
"dropdown.listBackground": colors.blackout,
"dropdown.border": colors.magenta33,
"dropdown.foreground": colors.white
const dropdown = (palette /*: Palette */) => ({
"dropdown.background": palette.blackout,
"dropdown.listBackground": palette.blackout,
"dropdown.border": palette.magenta33,
"dropdown.foreground": palette.white
});

module.exports = dropdown;
24 changes: 15 additions & 9 deletions src/colors/editor-groups-tabs.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#editor-groups-tabs
const editorGroupsTabs = colors => ({
"tab.activeBackground": colors.black,
"tab.activeForeground": colors.white,
"tab.border": colors.magenta33,
"tab.activeBorder": colors.magenta,
"tab.inactiveBackground": colors.black,
"tab.inactiveForeground": colors.white77,
"editorGroup.emptyBackground": colors.black,
"editorGroupHeader.tabsBackground": colors.black
const editorGroupsTabs = (palette /*: Palette */) => ({
"tab.activeBackground": palette.black,
"tab.activeForeground": palette.white,
"tab.border": palette.magenta33,
"tab.activeBorder": palette.magenta,
"tab.inactiveBackground": palette.black,
"tab.inactiveForeground": palette.white77,
"editorGroup.emptyBackground": palette.black,
"editorGroupHeader.tabsBackground": palette.black
});

module.exports = editorGroupsTabs;
28 changes: 17 additions & 11 deletions src/colors/editor-widget.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
const editorWidget = colors => ({
"editorWidget.background": colors.black,
"editorWidget.border": colors.magenta33,
"editorSuggestWidget.background": colors.black,
"editorSuggestWidget.foreground": colors.white,
"editorSuggestWidget.highlightForeground": colors.magenta,
"editorSuggestWidget.selectedBackground": colors.black,
const editorWidget = (palette /*: Palette */) => ({
"editorWidget.background": palette.black,
"editorWidget.border": palette.magenta33,
"editorSuggestWidget.background": palette.black,
"editorSuggestWidget.foreground": palette.white,
"editorSuggestWidget.highlightForeground": palette.magenta,
"editorSuggestWidget.selectedBackground": palette.black,
// editor marker navigation
"editorMarkerNavigation.background": colors.black,
"editorMarkerNavigationError.background": colors.red,
"editorMarkerNavigationWarning.background": colors.yellow,
"editorMarkerNavigationInfo.background": colors.blue
"editorMarkerNavigation.background": palette.black,
"editorMarkerNavigationError.background": palette.red,
"editorMarkerNavigationWarning.background": palette.yellow,
"editorMarkerNavigationInfo.background": palette.blue
});

module.exports = editorWidget;
88 changes: 47 additions & 41 deletions src/colors/editor.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#editor-colors
const editor = colors => ({
"editor.background": colors.black,
"editor.foreground": colors.white,
"editorLink.activeForeground": colors.magenta,
"editorLineNumber.foreground": colors.white77,
"editorLineNumber.activeForeground": colors.white,
"editor.rangeHighlightBackground": colors.magenta33,
"editor.selectionBackground": colors.magenta22,
"editor.selectionHighlightBackground": colors.magenta33,
"editor.selectionHighlightBorder": colors.magenta77,
"editor.wordHighlightBackground": colors.magenta33,
"editor.wordHighlightStrongBackground": colors.magenta33,
"editor.wordHighlightBorder": colors.magenta77,
"editor.findMatchHighlightBackground": colors.magenta33,
"editor.findRangeHighlightBackground": colors.magenta33,
"editor.findMatchBackground": colors.magenta33,
"editor.hoverHighlightBackground": colors.blackout,
"editorIndentGuide.background": colors.white33,
"editorIndentGuide.activeBackground": colors.magenta77,
"editorRuler.foreground": colors.magenta33,
"editorCodeLens.foreground": colors.magenta,
"editorBracketMatch.background": colors.black,
"editorBracketMatch.border": colors.magenta77,
const editor = (palette /*: Palette */) => ({
"editor.background": palette.black,
"editor.foreground": palette.white,
"editorLink.activeForeground": palette.magenta,
"editorLineNumber.foreground": palette.white77,
"editorLineNumber.activeForeground": palette.white,
"editor.rangeHighlightBackground": palette.magenta33,
"editor.selectionBackground": palette.magenta22,
"editor.selectionHighlightBackground": palette.magenta33,
"editor.selectionHighlightBorder": palette.magenta77,
"editor.wordHighlightBackground": palette.magenta33,
"editor.wordHighlightStrongBackground": palette.magenta33,
"editor.wordHighlightBorder": palette.magenta77,
"editor.findMatchHighlightBackground": palette.magenta33,
"editor.findRangeHighlightBackground": palette.magenta33,
"editor.findMatchBackground": palette.magenta33,
"editor.hoverHighlightBackground": palette.blackout,
"editorIndentGuide.background": palette.white33,
"editorIndentGuide.activeBackground": palette.magenta77,
"editorRuler.foreground": palette.magenta33,
"editorCodeLens.foreground": palette.magenta,
"editorBracketMatch.background": palette.black,
"editorBracketMatch.border": palette.magenta77,
// editor overview ruler
"editorOverviewRuler.border": colors.magenta33,
"editorOverviewRuler.findMatchForeground": colors.magenta77,
"editorOverviewRuler.addedForeground": colors.green,
"editorOverviewRuler.modifiedForeground": colors.magenta,
"editorOverviewRuler.bracketMatchForeground": colors.magenta,
"editorOverviewRuler.warningForeground": colors.yellow,
"editorOverviewRuler.infoForeground": colors.blue77,
"editorOverviewRuler.deletedForeground": colors.red,
"editorOverviewRuler.errorForeground": colors.red,
"editorOverviewRuler.border": palette.magenta33,
"editorOverviewRuler.findMatchForeground": palette.magenta77,
"editorOverviewRuler.addedForeground": palette.green,
"editorOverviewRuler.modifiedForeground": palette.magenta,
"editorOverviewRuler.bracketMatchForeground": palette.magenta,
"editorOverviewRuler.warningForeground": palette.yellow,
"editorOverviewRuler.infoForeground": palette.blue77,
"editorOverviewRuler.deletedForeground": palette.red,
"editorOverviewRuler.errorForeground": palette.red,
// editor errors and warnings
"editorError.foreground": colors.red,
"editorWarning.foreground": colors.yellow,
"editorInfo.foreground": colors.blue,
"editorHint.foreground": colors.magenta,
"editorUnnecessaryCode.border": colors.red,
"editorError.foreground": palette.red,
"editorWarning.foreground": palette.yellow,
"editorInfo.foreground": palette.blue,
"editorHint.foreground": palette.magenta,
"editorUnnecessaryCode.border": palette.red,
// editor gutter
"editorGutter.background": colors.black,
"editorGutter.addedBackground": colors.green,
"editorGutter.modifiedBackground": colors.magenta,
"editorGutter.deletedBackground": colors.red
"editorGutter.background": palette.black,
"editorGutter.addedBackground": palette.green,
"editorGutter.modifiedBackground": palette.magenta,
"editorGutter.deletedBackground": palette.red
});

module.exports = editor;
14 changes: 10 additions & 4 deletions src/colors/git.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#git-colors
const git = colors => ({
"gitDecoration.addedResourceForeground": colors.green,
"gitDecoration.modifiedResourceForeground": colors.magenta,
"gitDecoration.deletedResourceForeground": colors.red
const git = (palette /*: Palette */) => ({
"gitDecoration.addedResourceForeground": palette.green,
"gitDecoration.modifiedResourceForeground": palette.magenta,
"gitDecoration.deletedResourceForeground": palette.red
});

module.exports = git;
16 changes: 11 additions & 5 deletions src/colors/input.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// @flow

/* ::
import type {Palette} from '../types'
*/

// https://code.visualstudio.com/api/references/theme-color#input-control
// TODO: add inputValidation styles
const input = colors => ({
"input.background": colors.blackout,
"input.foreground": colors.white,
"input.placeholderForeground": colors.white77,
"inputOption.activeBorder": colors.magenta
const input = (palette /*: Palette */) => ({
"input.background": palette.blackout,
"input.foreground": palette.white,
"input.placeholderForeground": palette.white77,
"inputOption.activeBorder": palette.magenta
});

module.exports = input;
Loading

0 comments on commit 61dab54

Please sign in to comment.