Last active
October 6, 2017 12:02
-
-
Save noahlange/cc2bbca9094ac463480f8026e18e9b7f to your computer and use it in GitHub Desktop.
Updates VSCode Nord theme to add more contrast for comments and background.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { readdirSync, writeFileSync } = require('fs'); | |
const { homedir } = require('os'); | |
const colors = { | |
background: '#232731', | |
comment: '#818896', | |
highlight: '#292e39' | |
}; | |
const paths = { | |
extension: null, | |
extensions: `${ homedir() }/.vscode/extensions`, | |
nord: null | |
}; | |
const extensions = readdirSync(paths.extensions); | |
paths.extension = extensions.find(ext => ext.includes('nord')); | |
paths.nord = `${ paths.extension }/themes/nord.json`; | |
const theme = require(paths.nord); | |
const active = Object.assign({}, theme); | |
const backup = Object.freeze(Object.assign({}, theme)); | |
active.colors = Object.assign(active.colors, { | |
'editor.background': colors.background, | |
'editor.lineHighlightBackground': colors.highlight, | |
}); | |
active.tokenColors | |
.filter(token => token.name && token.name.includes('comment')) | |
.forEach(token => (token.settings.foreground = colors.comment)); | |
writeFileSync(`${ paths.nord }.bak`, JSON.stringify(backup)); | |
writeFileSync(paths.nord, JSON.stringify(active)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment