This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
# cardinal themes
These are the built in themes that come with cardinal.
You can create more themes by copying and then editing the [empty
theme](https://github.com/thlorenz/cardinal/blob/master/themes/empty.js) which is provided for that purpose.
The [hide semicolons theme](https://github.com/thlorenz/cardinal/blob/master/themes/hide-semicolons.js) has the added
benefit of making all semicolons invisible. This makes code more readable at times.
Find out how to change the theme used by cardinal [here](https://github.com/thlorenz/cardinal#theme).
# sharing themes
To add your theme to the cardinal built-in themes, follow the below steps:
1. fork the cardinal repository
2. add your theme to the themes folder and commit your changes
3. create a pull request
If you believe that your theme is better than the current default theme, let me know by creating an issue.
This will allow others to cast their vote. If enough people agree, your theme will be promoted to be the default.
## Contributed Themes
### tomorrow night
[![tomorrow-night](https://github.com/thlorenz/cardinal/raw/master/assets/theme-tomorrow-night.png)](https://github.com/thlorenz/cardinal/blob/master/themes/tomorrow-night.js)
*by [firede](https://github.com/firede)*
+201
View File
@@ -0,0 +1,201 @@
var colors = require('ansicolors')
// Change the below definitions in order to tweak the color theme.
module.exports = {
'Boolean': {
'true' : undefined
, 'false' : undefined
, _default : colors.brightRed
}
, 'Identifier': {
'undefined' : colors.brightBlack
, 'self' : colors.brightRed
, 'console' : colors.blue
, 'log' : colors.blue
, 'warn' : colors.red
, 'error' : colors.brightRed
, _default : colors.white
}
, 'Null': {
_default: colors.brightBlack
}
, 'Numeric': {
_default: colors.blue
}
, 'String': {
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
, 'Keyword': {
'break' : undefined
, 'case' : undefined
, 'catch' : colors.cyan
, 'class' : undefined
, 'const' : undefined
, 'continue' : undefined
, 'debugger' : undefined
, 'default' : undefined
, 'delete' : colors.red
, 'do' : undefined
, 'else' : undefined
, 'enum' : undefined
, 'export' : undefined
, 'extends' : undefined
, 'finally' : colors.cyan
, 'for' : undefined
, 'function' : undefined
, 'if' : undefined
, 'implements' : undefined
, 'import' : undefined
, 'in' : undefined
, 'instanceof' : undefined
, 'let' : undefined
, 'new' : colors.red
, 'package' : undefined
, 'private' : undefined
, 'protected' : undefined
, 'public' : undefined
, 'return' : colors.red
, 'static' : undefined
, 'super' : undefined
, 'switch' : undefined
, 'this' : colors.brightRed
, 'throw' : undefined
, 'try' : colors.cyan
, 'typeof' : undefined
, 'var' : colors.green
, 'void' : undefined
, 'while' : undefined
, 'with' : undefined
, 'yield' : undefined
, _default : colors.brightBlue
}
, 'Punctuator': {
';': colors.brightBlack
, '.': colors.green
, ',': colors.green
, '{': colors.yellow
, '}': colors.yellow
, '(': colors.brightBlack
, ')': colors.brightBlack
, '[': colors.yellow
, ']': colors.yellow
, '<': undefined
, '>': undefined
, '+': undefined
, '-': undefined
, '*': undefined
, '%': undefined
, '&': undefined
, '|': undefined
, '^': undefined
, '!': undefined
, '~': undefined
, '?': undefined
, ':': undefined
, '=': undefined
, '<=': undefined
, '>=': undefined
, '==': undefined
, '!=': undefined
, '++': undefined
, '--': undefined
, '<<': undefined
, '>>': undefined
, '&&': undefined
, '||': undefined
, '+=': undefined
, '-=': undefined
, '*=': undefined
, '%=': undefined
, '&=': undefined
, '|=': undefined
, '^=': undefined
, '/=': undefined
, '=>': undefined
, '**': undefined
, '===': undefined
, '!==': undefined
, '>>>': undefined
, '<<=': undefined
, '>>=': undefined
, '...': undefined
, '**=': undefined
, '>>>=': undefined
, _default: colors.brightYellow
}
// line comment
, Line: {
_default: colors.brightBlack
}
/* block comment */
, Block: {
_default: colors.brightBlack
}
// JSX
, JSXAttribute: {
_default: colors.magenta
}
, JSXClosingElement: {
_default: colors.magenta
}
, JSXElement: {
_default: colors.magenta
}
, JSXEmptyExpression: {
_default: colors.magenta
}
, JSXExpressionContainer: {
_default: colors.magenta
}
, JSXIdentifier: {
className: colors.blue
, _default: colors.magenta
}
, JSXMemberExpression: {
_default: colors.magenta
}
, JSXNamespacedName: {
_default: colors.magenta
}
, JSXOpeningElement: {
_default: colors.magenta
}
, JSXSpreadAttribute: {
_default: colors.magenta
}
, JSXText: {
_default: colors.brightGreen
}
, _default: undefined
}
+199
View File
@@ -0,0 +1,199 @@
/*
* Copy this file and use it as a starting point for your custom cardinal color theme.
* Just fill in or change the entries for the tokens you want to color
* Keep in mind that more specific configurations override less specific ones.
*/
// eslint-disable-next-line no-unused-vars
var colors = require('ansicolors')
// Change the below definitions in order to tweak the color theme.
module.exports = {
'Boolean': {
'true' : undefined
, 'false' : undefined
, _default : undefined
}
, 'Identifier': {
_default: undefined
}
, 'Null': {
_default: undefined
}
, 'Numeric': {
_default: undefined
}
, 'String': {
_default: undefined
}
, 'Keyword': {
'break' : undefined
, 'case' : undefined
, 'catch' : undefined
, 'class' : undefined
, 'const' : undefined
, 'continue' : undefined
, 'debugger' : undefined
, 'default' : undefined
, 'delete' : undefined
, 'do' : undefined
, 'else' : undefined
, 'enum' : undefined
, 'export' : undefined
, 'extends' : undefined
, 'finally' : undefined
, 'for' : undefined
, 'function' : undefined
, 'if' : undefined
, 'implements' : undefined
, 'import' : undefined
, 'in' : undefined
, 'instanceof' : undefined
, 'interface' : undefined
, 'let' : undefined
, 'new' : undefined
, 'package' : undefined
, 'private' : undefined
, 'protected' : undefined
, 'public' : undefined
, 'return' : undefined
, 'static' : undefined
, 'super' : undefined
, 'switch' : undefined
, 'this' : undefined
, 'throw' : undefined
, 'try' : undefined
, 'typeof' : undefined
, 'var' : undefined
, 'void' : undefined
, 'while' : undefined
, 'with' : undefined
, 'yield' : undefined
, _default : undefined
}
, 'Punctuator': {
';': undefined
, '.': undefined
, ',': undefined
, '{': undefined
, '}': undefined
, '(': undefined
, ')': undefined
, '[': undefined
, ']': undefined
, '<': undefined
, '>': undefined
, '+': undefined
, '-': undefined
, '*': undefined
, '%': undefined
, '&': undefined
, '|': undefined
, '^': undefined
, '!': undefined
, '~': undefined
, '?': undefined
, ':': undefined
, '=': undefined
, '<=': undefined
, '>=': undefined
, '==': undefined
, '!=': undefined
, '++': undefined
, '--': undefined
, '<<': undefined
, '>>': undefined
, '&&': undefined
, '||': undefined
, '+=': undefined
, '-=': undefined
, '*=': undefined
, '%=': undefined
, '&=': undefined
, '|=': undefined
, '^=': undefined
, '/=': undefined
, '=>': undefined
, '**': undefined
, '===': undefined
, '!==': undefined
, '>>>': undefined
, '<<=': undefined
, '>>=': undefined
, '...': undefined
, '**=': undefined
, '>>>=': undefined
, _default: undefined
}
// line comment
, Line: {
_default: undefined
}
/* block comment */
, Block: {
_default: undefined
}
// JSX
, JSXAttribute: {
_default: undefined
}
, JSXClosingElement: {
_default: undefined
}
, JSXElement: {
_default: undefined
}
, JSXEmptyExpression: {
_default: undefined
}
, JSXExpressionContainer: {
_default: undefined
}
, JSXIdentifier: {
// many more identifies are possible, div, table, etc.
className: undefined
, _default: undefined
}
, JSXMemberExpression: {
_default: undefined
}
, JSXNamespacedName: {
_default: undefined
}
, JSXOpeningElement: {
_default: undefined
}
, JSXSpreadAttribute: {
_default: undefined
}
, JSXText: {
_default: undefined
}
, _default: undefined
}
+202
View File
@@ -0,0 +1,202 @@
var colors = require('ansicolors')
// Change the below definitions in order to tweak the color theme.
module.exports = {
'Boolean': {
'true' : undefined
, 'false' : undefined
, _default : colors.brightRed
}
, 'Identifier': {
'undefined' : colors.brightBlack
, 'self' : colors.brightRed
, 'console' : colors.blue
, 'log' : colors.blue
, 'warn' : colors.red
, 'error' : colors.brightRed
, _default : colors.white
}
, 'Null': {
_default: colors.brightBlack
}
, 'Numeric': {
_default: colors.blue
}
, 'String': {
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
, 'Keyword': {
'break' : undefined
, 'case' : undefined
, 'catch' : colors.cyan
, 'class' : undefined
, 'const' : undefined
, 'continue' : undefined
, 'debugger' : undefined
, 'default' : undefined
, 'delete' : colors.red
, 'do' : undefined
, 'else' : undefined
, 'enum' : undefined
, 'export' : undefined
, 'extends' : undefined
, 'finally' : colors.cyan
, 'for' : undefined
, 'function' : undefined
, 'if' : undefined
, 'implements' : undefined
, 'import' : undefined
, 'in' : undefined
, 'instanceof' : undefined
, 'let' : undefined
, 'new' : colors.red
, 'package' : undefined
, 'private' : undefined
, 'protected' : undefined
, 'public' : undefined
, 'return' : colors.red
, 'static' : undefined
, 'super' : undefined
, 'switch' : undefined
, 'this' : colors.brightRed
, 'throw' : undefined
, 'try' : colors.cyan
, 'typeof' : undefined
, 'var' : colors.green
, 'void' : undefined
, 'while' : undefined
, 'with' : undefined
, 'yield' : undefined
, _default : colors.brightBlue
}
, 'Punctuator': {
// setting semicolon's color to the same as the terminal background makes it invisible
';': colors.black
, '.': colors.green
, ',': colors.green
, '{': colors.yellow
, '}': colors.yellow
, '(': colors.brightBlack
, ')': colors.brightBlack
, '[': colors.yellow
, ']': colors.yellow
, '<': undefined
, '>': undefined
, '+': undefined
, '-': undefined
, '*': undefined
, '%': undefined
, '&': undefined
, '|': undefined
, '^': undefined
, '!': undefined
, '~': undefined
, '?': undefined
, ':': undefined
, '=': undefined
, '<=': undefined
, '>=': undefined
, '==': undefined
, '!=': undefined
, '++': undefined
, '--': undefined
, '<<': undefined
, '>>': undefined
, '&&': undefined
, '||': undefined
, '+=': undefined
, '-=': undefined
, '*=': undefined
, '%=': undefined
, '&=': undefined
, '|=': undefined
, '^=': undefined
, '/=': undefined
, '=>': undefined
, '**': undefined
, '===': undefined
, '!==': undefined
, '>>>': undefined
, '<<=': undefined
, '>>=': undefined
, '...': undefined
, '**=': undefined
, '>>>=': undefined
, _default: colors.brightYellow
}
// line comment
, Line: {
_default: colors.brightBlack
}
/* block comment */
, Block: {
_default: colors.brightBlack
}
// JSX
, JSXAttribute: {
_default: colors.magenta
}
, JSXClosingElement: {
_default: colors.magenta
}
, JSXElement: {
_default: colors.magenta
}
, JSXEmptyExpression: {
_default: colors.magenta
}
, JSXExpressionContainer: {
_default: colors.magenta
}
, JSXIdentifier: {
className: colors.blue
, _default: colors.magenta
}
, JSXMemberExpression: {
_default: colors.magenta
}
, JSXNamespacedName: {
_default: colors.magenta
}
, JSXOpeningElement: {
_default: colors.magenta
}
, JSXSpreadAttribute: {
_default: colors.magenta
}
, JSXText: {
_default: colors.brightGreen
}
, _default: undefined
}
+169
View File
@@ -0,0 +1,169 @@
var colors = require('ansicolors')
// mimics [jq](https://stedolan.github.io/jq/) highlighting for json files
// mainly in the fact that the keys are a clearly different color than the strings
// However improvements to this theme are highly welcome! :)
// Change the below definitions in order to tweak the color theme.
module.exports = {
'Boolean': {
'true' : undefined
, 'false' : undefined
, _default : colors.brightRed
}
, 'Identifier': {
'undefined' : colors.brightBlack
, 'self' : colors.brightRed
, 'console' : colors.blue
, 'log' : colors.blue
, 'warn' : colors.red
, 'error' : colors.brightRed
, _default : colors.white
}
, 'Null': {
_default: colors.brightBlack
}
, 'Numeric': {
_default: colors.blue
}
, 'String': {
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.brightBlue(s)
: colors.brightGreen(s)
}
}
, 'Keyword': {
'break' : undefined
, 'case' : undefined
, 'catch' : colors.cyan
, 'class' : undefined
, 'const' : undefined
, 'continue' : undefined
, 'debugger' : undefined
, 'default' : undefined
, 'delete' : colors.red
, 'do' : undefined
, 'else' : undefined
, 'enum' : undefined
, 'export' : undefined
, 'extends' : undefined
, 'finally' : colors.cyan
, 'for' : undefined
, 'function' : undefined
, 'if' : undefined
, 'implements' : undefined
, 'import' : undefined
, 'in' : undefined
, 'instanceof' : undefined
, 'let' : undefined
, 'new' : colors.red
, 'package' : undefined
, 'private' : undefined
, 'protected' : undefined
, 'public' : undefined
, 'return' : colors.red
, 'static' : undefined
, 'super' : undefined
, 'switch' : undefined
, 'this' : colors.brightRed
, 'throw' : undefined
, 'try' : colors.cyan
, 'typeof' : undefined
, 'var' : colors.green
, 'void' : undefined
, 'while' : undefined
, 'with' : undefined
, 'yield' : undefined
, _default : colors.brightBlue
}
, 'Punctuator': {
';': colors.brightBlack
, '.': colors.green
, ',': colors.green
, '{': colors.brightWhite
, '}': colors.brightWhite
, '(': colors.brightBlack
, ')': colors.brightBlack
, '[': colors.brightWhite
, ']': colors.brightWhite
, '<': undefined
, '>': undefined
, '+': undefined
, '-': undefined
, '*': undefined
, '%': undefined
, '&': undefined
, '|': undefined
, '^': undefined
, '!': undefined
, '~': undefined
, '?': undefined
, ':': undefined
, '=': undefined
, '<=': undefined
, '>=': undefined
, '==': undefined
, '!=': undefined
, '++': undefined
, '--': undefined
, '<<': undefined
, '>>': undefined
, '&&': undefined
, '||': undefined
, '+=': undefined
, '-=': undefined
, '*=': undefined
, '%=': undefined
, '&=': undefined
, '|=': undefined
, '^=': undefined
, '/=': undefined
, '=>': undefined
, '**': undefined
, '===': undefined
, '!==': undefined
, '>>>': undefined
, '<<=': undefined
, '>>=': undefined
, '...': undefined
, '**=': undefined
, '>>>=': undefined
, _default: colors.brightYellow
}
// line comment
, Line: {
_default: colors.brightBlack
}
/* block comment */
, Block: {
_default: colors.brightBlack
}
, _default: undefined
}
+215
View File
@@ -0,0 +1,215 @@
var colors = require('ansicolors')
// Change the below definitions in order to tweak the color theme.
module.exports = {
'Boolean': {
'true' : undefined
, 'false' : undefined
, _default : colors.yellow
}
, 'Identifier': {
'undefined' : colors.yellow
, 'self' : colors.yellow
, 'type' : colors.yellow
, 'value' : colors.yellow
, 'console' : undefined
, 'log' : colors.blue
, 'warn' : colors.blue
, 'error' : colors.blue
, 'join' : colors.blue
, _default : function(s, info) {
var prevToken = info.tokens[info.tokenIndex - 1]
var nextToken = info.tokens[info.tokenIndex + 1]
return (nextToken
&& nextToken.type === 'Punctuator'
&& nextToken.value === '('
&& prevToken
&& prevToken.type === 'Keyword'
&& prevToken.value === 'function'
) ? colors.blue(s) : colors.white(s)
}
}
, 'Null': {
_default: colors.yellow
}
, 'Numeric': {
_default: colors.yellow
}
, 'String': {
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
, 'Keyword': {
'break' : colors.magenta
, 'case' : colors.magenta
, 'catch' : colors.magenta
, 'class' : undefined
, 'const' : undefined
, 'continue' : colors.magenta
, 'debugger' : colors.magenta
, 'default' : colors.magenta
, 'delete' : colors.red
, 'do' : colors.magenta
, 'else' : colors.magenta
, 'enum' : undefined
, 'export' : undefined
, 'extends' : undefined
, 'finally' : colors.magenta
, 'for' : colors.magenta
, 'function' : colors.magenta
, 'if' : colors.magenta
, 'implements' : undefined
, 'import' : undefined
, 'in' : colors.cyan
, 'instanceof' : colors.cyan
, 'let' : undefined
, 'new' : colors.cyan
, 'package' : undefined
, 'private' : undefined
, 'protected' : undefined
, 'public' : undefined
, 'return' : colors.magenta
, 'static' : undefined
, 'super' : undefined
, 'switch' : colors.magenta
, 'this' : colors.red
, 'throw' : colors.magenta
, 'try' : colors.magenta
, 'typeof' : colors.cyan
, 'var' : colors.magenta
, 'void' : colors.magenta
, 'while' : colors.magenta
, 'with' : colors.cyan
, 'yield' : undefined
, _default : colors.white
}
, 'Punctuator': {
';': colors.white
, '.': colors.white
, ',': colors.white
, '{': colors.white
, '}': colors.white
, '(': colors.white
, ')': colors.white
, '[': colors.white
, ']': colors.white
, '<': undefined
, '>': undefined
, '+': undefined
, '-': undefined
, '*': undefined
, '%': undefined
, '&': undefined
, '|': colors.white
, '^': undefined
, '!': undefined
, '~': undefined
, '?': colors.white
, ':': colors.white
, '=': undefined
, '<=': undefined
, '>=': undefined
, '==': undefined
, '!=': undefined
, '++': undefined
, '--': undefined
, '<<': undefined
, '>>': undefined
, '&&': undefined
, '||': undefined
, '+=': undefined
, '-=': undefined
, '*=': undefined
, '%=': undefined
, '&=': undefined
, '|=': undefined
, '^=': undefined
, '/=': undefined
, '=>': undefined
, '**': undefined
, '===': undefined
, '!==': undefined
, '>>>': undefined
, '<<=': undefined
, '>>=': undefined
, '...': undefined
, '**=': undefined
, '>>>=': undefined
, _default: colors.cyan
}
// line comment
, Line: {
_default: colors.brightBlack
}
/* block comment */
, Block: {
_default: colors.brightBlack
}
// JSX
, JSXAttribute: {
_default: colors.magenta
}
, JSXClosingElement: {
_default: colors.magenta
}
, JSXElement: {
_default: colors.magenta
}
, JSXEmptyExpression: {
_default: colors.magenta
}
, JSXExpressionContainer: {
_default: colors.magenta
}
, JSXIdentifier: {
className: colors.blue
, _default: colors.magenta
}
, JSXMemberExpression: {
_default: colors.magenta
}
, JSXNamespacedName: {
_default: colors.magenta
}
, JSXOpeningElement: {
_default: colors.magenta
}
, JSXSpreadAttribute: {
_default: colors.magenta
}
, JSXText: {
_default: colors.brightGreen
}
, _default: undefined
}