UNPKG

@uiw/codemirror-theme-tokyo-night

Version:
99 lines (98 loc) 3.6 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; Object.defineProperty(exports, "__esModule", { value: true }); exports.tokyoNightStyle = exports.tokyoNightInit = exports.tokyoNight = exports.defaultSettingsTokyoNight = 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 defaultSettingsTokyoNight = exports.defaultSettingsTokyoNight = { background: '#1a1b26', foreground: '#787c99', caret: '#c0caf5', selection: '#515c7e40', selectionMatch: '#16161e', gutterBackground: '#1a1b26', gutterForeground: '#787c99', gutterBorder: 'transparent', lineHighlight: '#474b6611' }; var tokyoNightStyle = exports.tokyoNightStyle = [{ tag: _highlight.tags.keyword, color: '#bb9af7' }, { tag: [_highlight.tags.name, _highlight.tags.deleted, _highlight.tags.character, _highlight.tags.macroName], color: '#c0caf5' }, { tag: [_highlight.tags.propertyName], color: '#7aa2f7' }, { tag: [_highlight.tags.processingInstruction, _highlight.tags.string, _highlight.tags.inserted, _highlight.tags.special(_highlight.tags.string)], color: '#9ece6a' }, { tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags.labelName], color: '#7aa2f7' }, { tag: [_highlight.tags.color, _highlight.tags.constant(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.name)], color: '#bb9af7' }, { tag: [_highlight.tags.definition(_highlight.tags.name), _highlight.tags.separator], color: '#c0caf5' }, { tag: [_highlight.tags.className], color: '#c0caf5' }, { tag: [_highlight.tags.number, _highlight.tags.changed, _highlight.tags.annotation, _highlight.tags.modifier, _highlight.tags.self, _highlight.tags.namespace], color: '#ff9e64' }, { tag: [_highlight.tags.typeName], color: '#0db9d7' }, { tag: [_highlight.tags.operator, _highlight.tags.operatorKeyword], color: '#bb9af7' }, { tag: [_highlight.tags.url, _highlight.tags.escape, _highlight.tags.regexp, _highlight.tags.link], color: '#b4f9f8' }, { tag: [_highlight.tags.meta, _highlight.tags.comment], color: '#444b6a' }, { 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: '#89ddff' }, { tag: [_highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)], color: '#c0caf5' }, { tag: _highlight.tags.invalid, color: '#ff5370' }, { tag: _highlight.tags.strikethrough, textDecoration: 'line-through' }]; var tokyoNightInit = exports.tokyoNightInit = function tokyoNightInit(options) { var _ref = options || {}, _ref$theme = _ref.theme, theme = _ref$theme === void 0 ? 'dark' : _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"])({}, defaultSettingsTokyoNight), settings), styles: [].concat(tokyoNightStyle, (0, _toConsumableArray2["default"])(styles)) }); }; var tokyoNight = exports.tokyoNight = tokyoNightInit();