UNPKG

@uiw/codemirror-theme-tokyo-night-day

Version:

Theme tokyo-night-day for CodeMirror.

100 lines (99 loc) 3.67 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; Object.defineProperty(exports, "__esModule", { value: true }); exports.tokyoNightDayStyle = exports.tokyoNightDayInit = exports.tokyoNightDay = exports.defaultSettingsTokyoNightDay = void 0; var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); var _highlight = require("@lezer/highlight"); var _codemirrorThemes = require("@uiw/codemirror-themes"); var defaultSettingsTokyoNightDay = exports.defaultSettingsTokyoNightDay = { background: '#e1e2e7', foreground: '#3760bf', caret: '#3760bf', selection: '#99a7df', selectionMatch: '#99a7df', gutterBackground: '#e1e2e7', gutterForeground: '#3760bf', gutterBorder: 'transparent', lineHighlight: '#5f5faf11' }; var tokyoNightDayStyle = exports.tokyoNightDayStyle = [{ tag: _highlight.tags.keyword, color: '#007197' }, { tag: [_highlight.tags.name, _highlight.tags.deleted, _highlight.tags.character, _highlight.tags.macroName], color: '#3760bf' }, { tag: [_highlight.tags.propertyName], color: '#3760bf' }, { tag: [_highlight.tags.processingInstruction, _highlight.tags.string, _highlight.tags.inserted, _highlight.tags.special(_highlight.tags.string)], color: '#587539' }, { tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags.labelName], color: '#3760bf' }, { tag: [_highlight.tags.color, _highlight.tags.constant(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.name)], color: '#3760bf' }, { tag: [_highlight.tags.definition(_highlight.tags.name), _highlight.tags.separator], color: '#3760bf' }, { tag: [_highlight.tags.className], color: '#3760bf' }, { tag: [_highlight.tags.number, _highlight.tags.changed, _highlight.tags.annotation, _highlight.tags.modifier, _highlight.tags.self, _highlight.tags.namespace], color: '#b15c00' }, { tag: [_highlight.tags.typeName], color: '#007197', fontStyle: '#007197' }, { tag: [_highlight.tags.operator, _highlight.tags.operatorKeyword], color: '#007197' }, { tag: [_highlight.tags.url, _highlight.tags.escape, _highlight.tags.regexp, _highlight.tags.link], color: '#587539' }, { tag: [_highlight.tags.meta, _highlight.tags.comment], color: '#848cb5' }, { tag: _highlight.tags.strong, fontWeight: 'bold' }, { tag: _highlight.tags.emphasis, fontStyle: 'italic' }, { tag: _highlight.tags.link, textDecoration: 'underline' }, { tag: _highlight.tags.heading, fontWeight: 'bold', color: '#b15c00' }, { tag: [_highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)], color: '#3760bf' }, { tag: _highlight.tags.invalid, color: '#f52a65' }, { tag: _highlight.tags.strikethrough, textDecoration: 'line-through' }]; var tokyoNightDayInit = exports.tokyoNightDayInit = function tokyoNightDayInit(options) { var _ref = options || {}, _ref$theme = _ref.theme, theme = _ref$theme === void 0 ? 'light' : _ref$theme, _ref$settings = _ref.settings, settings = _ref$settings === void 0 ? {} : _ref$settings, _ref$styles = _ref.styles, styles = _ref$styles === void 0 ? [] : _ref$styles; return (0, _codemirrorThemes.createTheme)({ theme: theme, settings: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultSettingsTokyoNightDay), settings), styles: [].concat(tokyoNightDayStyle, (0, _toConsumableArray2["default"])(styles)) }); }; var tokyoNightDay = exports.tokyoNightDay = tokyoNightDayInit();