@fsegurai/codemirror-theme-solarized-dark 6.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ <!-- NOTE: README.md is generated from src/README.md -->
2
+
3
+ # @fsegurai/codemirror-theme-solarized-dark [![NPM version](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-solarized-dark.svg)](https://www.npmjs.org/package/@fsegurai/codemirror-theme-solarized-dark)
4
+
5
+ [ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/codemirror.next/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/theme-one-dark/blob/main/CHANGELOG.md) ]
6
+
7
+ This package implements the Solarized Dark theme for the
8
+ [CodeMirror](https://codemirror.net/6/) code editor.
9
+
10
+ The [project page](https://codemirror.net/6/) has more information, a
11
+ number of [examples](https://codemirror.net/6/examples/) and the
12
+ [documentation](https://codemirror.net/6/docs/).
13
+
14
+ This code is released under an
15
+ [MIT license](https://github.com/fsegurai/cm6-themes/tree/main/LICENSE).
16
+
17
+ We aim to be an inclusive, welcoming community. To make that explicit,
18
+ we have a [code of
19
+ conduct](http://contributor-covenant.org/version/1/1/0/) that applies
20
+ to communication around the project.
21
+
22
+ ## API Reference
23
+
24
+ @solarizedDark
25
+
26
+ @solarizedDarkTheme
27
+
28
+ @solarizedDarkHighlightStyle
package/dist/index.cjs ADDED
@@ -0,0 +1,170 @@
1
+ 'use strict';
2
+
3
+ var view = require('@codemirror/view');
4
+ var language = require('@codemirror/language');
5
+ var highlight = require('@lezer/highlight');
6
+
7
+ const base00 = '#002b36', base01 = '#073642', base02 = '#586e75', base03 = '#657b83', base04 = '#839496', base05 = '#93a1a1', base06 = '#eee8d5', base07 = '#fdf6e3', base_red = '#dc322f', base_orange = '#cb4b16', base_yellow = '#b58900', base_green = '#859900', base_cyan = '#2aa198', base_blue = '#268bd2', base_violet = '#6c71c4', base_magenta = '#d33682';
8
+ const invalid = '#d30102', stone = base04, darkBackground = '#00252f', highlightBackground = '#173541', background = base00, tooltipBackground = base01, selection = '#173541', cursor = base04;
9
+ /// The editor theme styles for Solarized Dark.
10
+ const solarizedDarkTheme = view.EditorView.theme({
11
+ '&': {
12
+ color: base05,
13
+ backgroundColor: background
14
+ },
15
+ '.cm-content': {
16
+ caretColor: cursor
17
+ },
18
+ '.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },
19
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: selection },
20
+ '.cm-panels': { backgroundColor: darkBackground, color: base03 },
21
+ '.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },
22
+ '.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },
23
+ '.cm-searchMatch': {
24
+ backgroundColor: '#72a1ff59',
25
+ outline: '1px solid #457dff'
26
+ },
27
+ '.cm-searchMatch.cm-searchMatch-selected': {
28
+ backgroundColor: '#6199ff2f'
29
+ },
30
+ '.cm-activeLine': { backgroundColor: highlightBackground },
31
+ '.cm-selectionMatch': { backgroundColor: '#aafe661a' },
32
+ '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
33
+ outline: `1px solid ${base06}`
34
+ },
35
+ '.cm-gutters': {
36
+ backgroundColor: darkBackground,
37
+ color: stone,
38
+ border: 'none'
39
+ },
40
+ '.cm-activeLineGutter': {
41
+ backgroundColor: highlightBackground
42
+ },
43
+ '.cm-foldPlaceholder': {
44
+ backgroundColor: 'transparent',
45
+ border: 'none',
46
+ color: '#ddd'
47
+ },
48
+ '.cm-tooltip': {
49
+ border: 'none',
50
+ backgroundColor: tooltipBackground
51
+ },
52
+ '.cm-tooltip .cm-tooltip-arrow:before': {
53
+ borderTopColor: 'transparent',
54
+ borderBottomColor: 'transparent'
55
+ },
56
+ '.cm-tooltip .cm-tooltip-arrow:after': {
57
+ borderTopColor: tooltipBackground,
58
+ borderBottomColor: tooltipBackground
59
+ },
60
+ '.cm-tooltip-autocomplete': {
61
+ '& > ul > li[aria-selected]': {
62
+ backgroundColor: highlightBackground,
63
+ color: base03
64
+ }
65
+ }
66
+ }, { dark: true });
67
+ /// The highlighting style for code in the Solarized Dark theme.
68
+ const solarizedDarkHighlightStyle = language.HighlightStyle.define([
69
+ { tag: highlight.tags.keyword, color: base_green },
70
+ {
71
+ tag: [highlight.tags.name, highlight.tags.deleted, highlight.tags.character, highlight.tags.propertyName, highlight.tags.macroName],
72
+ color: base_cyan
73
+ },
74
+ { tag: [highlight.tags.variableName], color: base05 },
75
+ { tag: [highlight.tags.function(highlight.tags.variableName)], color: base_blue },
76
+ { tag: [highlight.tags.labelName], color: base_magenta },
77
+ {
78
+ tag: [highlight.tags.color, highlight.tags.constant(highlight.tags.name), highlight.tags.standard(highlight.tags.name)],
79
+ color: base_yellow
80
+ },
81
+ { tag: [highlight.tags.definition(highlight.tags.name), highlight.tags.separator], color: base_cyan },
82
+ { tag: [highlight.tags.brace], color: base_magenta },
83
+ {
84
+ tag: [highlight.tags.annotation],
85
+ color: invalid
86
+ },
87
+ {
88
+ tag: [highlight.tags.number, highlight.tags.changed, highlight.tags.annotation, highlight.tags.modifier, highlight.tags.self, highlight.tags.namespace],
89
+ color: base_magenta
90
+ },
91
+ {
92
+ tag: [highlight.tags.typeName, highlight.tags.className],
93
+ color: base_orange
94
+ },
95
+ {
96
+ tag: [highlight.tags.operator, highlight.tags.operatorKeyword],
97
+ color: base_violet
98
+ },
99
+ {
100
+ tag: [highlight.tags.tagName],
101
+ color: base_blue
102
+ },
103
+ {
104
+ tag: [highlight.tags.squareBracket],
105
+ color: base_red
106
+ },
107
+ {
108
+ tag: [highlight.tags.angleBracket],
109
+ color: base02
110
+ },
111
+ {
112
+ tag: [highlight.tags.attributeName],
113
+ color: base05
114
+ },
115
+ {
116
+ tag: [highlight.tags.regexp],
117
+ color: invalid
118
+ },
119
+ {
120
+ tag: [highlight.tags.quote],
121
+ color: base_green
122
+ },
123
+ { tag: [highlight.tags.string], color: base_yellow },
124
+ {
125
+ tag: highlight.tags.link,
126
+ color: base_cyan,
127
+ textDecoration: 'underline',
128
+ textUnderlinePosition: 'under'
129
+ },
130
+ {
131
+ tag: [highlight.tags.url, highlight.tags.escape, highlight.tags.special(highlight.tags.string)],
132
+ color: base_yellow
133
+ },
134
+ { tag: [highlight.tags.meta], color: base_red },
135
+ { tag: [highlight.tags.comment], color: base02, fontStyle: 'italic' },
136
+ { tag: highlight.tags.strong, fontWeight: 'bold', color: base06 },
137
+ { tag: highlight.tags.emphasis, fontStyle: 'italic', color: base_green },
138
+ { tag: highlight.tags.strikethrough, textDecoration: 'line-through' },
139
+ { tag: highlight.tags.heading, fontWeight: 'bold', color: base_yellow },
140
+ { tag: highlight.tags.heading1, fontWeight: 'bold', color: base07 },
141
+ {
142
+ tag: [highlight.tags.heading2, highlight.tags.heading3, highlight.tags.heading4],
143
+ fontWeight: 'bold',
144
+ color: base06
145
+ },
146
+ {
147
+ tag: [highlight.tags.heading5, highlight.tags.heading6],
148
+ color: base06
149
+ },
150
+ { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base_magenta },
151
+ {
152
+ tag: [highlight.tags.processingInstruction, highlight.tags.inserted, highlight.tags.contentSeparator],
153
+ color: base_red
154
+ },
155
+ {
156
+ tag: [highlight.tags.contentSeparator],
157
+ color: base_yellow
158
+ },
159
+ { tag: highlight.tags.invalid, color: base02, borderBottom: `1px dotted ${base_red}` }
160
+ ]);
161
+ /// Extension to enable the Solarized Dark theme (both the editor theme and
162
+ /// the highlight style).
163
+ const solarizedDark = [
164
+ solarizedDarkTheme,
165
+ language.syntaxHighlighting(solarizedDarkHighlightStyle)
166
+ ];
167
+
168
+ exports.solarizedDark = solarizedDark;
169
+ exports.solarizedDarkHighlightStyle = solarizedDarkHighlightStyle;
170
+ exports.solarizedDarkTheme = solarizedDarkTheme;
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const solarizedDarkTheme: Extension;
5
+ declare const solarizedDarkHighlightStyle: HighlightStyle;
6
+ declare const solarizedDark: Extension;
7
+
8
+ export { solarizedDark, solarizedDarkHighlightStyle, solarizedDarkTheme };
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const solarizedDarkTheme: Extension;
5
+ declare const solarizedDarkHighlightStyle: HighlightStyle;
6
+ declare const solarizedDark: Extension;
7
+
8
+ export { solarizedDark, solarizedDarkHighlightStyle, solarizedDarkTheme };
package/dist/index.js ADDED
@@ -0,0 +1,166 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+
5
+ const base00 = '#002b36', base01 = '#073642', base02 = '#586e75', base03 = '#657b83', base04 = '#839496', base05 = '#93a1a1', base06 = '#eee8d5', base07 = '#fdf6e3', base_red = '#dc322f', base_orange = '#cb4b16', base_yellow = '#b58900', base_green = '#859900', base_cyan = '#2aa198', base_blue = '#268bd2', base_violet = '#6c71c4', base_magenta = '#d33682';
6
+ const invalid = '#d30102', stone = base04, darkBackground = '#00252f', highlightBackground = '#173541', background = base00, tooltipBackground = base01, selection = '#173541', cursor = base04;
7
+ /// The editor theme styles for Solarized Dark.
8
+ const solarizedDarkTheme = /*@__PURE__*/EditorView.theme({
9
+ '&': {
10
+ color: base05,
11
+ backgroundColor: background
12
+ },
13
+ '.cm-content': {
14
+ caretColor: cursor
15
+ },
16
+ '.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },
17
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: selection },
18
+ '.cm-panels': { backgroundColor: darkBackground, color: base03 },
19
+ '.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },
20
+ '.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },
21
+ '.cm-searchMatch': {
22
+ backgroundColor: '#72a1ff59',
23
+ outline: '1px solid #457dff'
24
+ },
25
+ '.cm-searchMatch.cm-searchMatch-selected': {
26
+ backgroundColor: '#6199ff2f'
27
+ },
28
+ '.cm-activeLine': { backgroundColor: highlightBackground },
29
+ '.cm-selectionMatch': { backgroundColor: '#aafe661a' },
30
+ '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
31
+ outline: `1px solid ${base06}`
32
+ },
33
+ '.cm-gutters': {
34
+ backgroundColor: darkBackground,
35
+ color: stone,
36
+ border: 'none'
37
+ },
38
+ '.cm-activeLineGutter': {
39
+ backgroundColor: highlightBackground
40
+ },
41
+ '.cm-foldPlaceholder': {
42
+ backgroundColor: 'transparent',
43
+ border: 'none',
44
+ color: '#ddd'
45
+ },
46
+ '.cm-tooltip': {
47
+ border: 'none',
48
+ backgroundColor: tooltipBackground
49
+ },
50
+ '.cm-tooltip .cm-tooltip-arrow:before': {
51
+ borderTopColor: 'transparent',
52
+ borderBottomColor: 'transparent'
53
+ },
54
+ '.cm-tooltip .cm-tooltip-arrow:after': {
55
+ borderTopColor: tooltipBackground,
56
+ borderBottomColor: tooltipBackground
57
+ },
58
+ '.cm-tooltip-autocomplete': {
59
+ '& > ul > li[aria-selected]': {
60
+ backgroundColor: highlightBackground,
61
+ color: base03
62
+ }
63
+ }
64
+ }, { dark: true });
65
+ /// The highlighting style for code in the Solarized Dark theme.
66
+ const solarizedDarkHighlightStyle = /*@__PURE__*/HighlightStyle.define([
67
+ { tag: tags.keyword, color: base_green },
68
+ {
69
+ tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
70
+ color: base_cyan
71
+ },
72
+ { tag: [tags.variableName], color: base05 },
73
+ { tag: [/*@__PURE__*/tags.function(tags.variableName)], color: base_blue },
74
+ { tag: [tags.labelName], color: base_magenta },
75
+ {
76
+ tag: [tags.color, /*@__PURE__*/tags.constant(tags.name), /*@__PURE__*/tags.standard(tags.name)],
77
+ color: base_yellow
78
+ },
79
+ { tag: [/*@__PURE__*/tags.definition(tags.name), tags.separator], color: base_cyan },
80
+ { tag: [tags.brace], color: base_magenta },
81
+ {
82
+ tag: [tags.annotation],
83
+ color: invalid
84
+ },
85
+ {
86
+ tag: [tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
87
+ color: base_magenta
88
+ },
89
+ {
90
+ tag: [tags.typeName, tags.className],
91
+ color: base_orange
92
+ },
93
+ {
94
+ tag: [tags.operator, tags.operatorKeyword],
95
+ color: base_violet
96
+ },
97
+ {
98
+ tag: [tags.tagName],
99
+ color: base_blue
100
+ },
101
+ {
102
+ tag: [tags.squareBracket],
103
+ color: base_red
104
+ },
105
+ {
106
+ tag: [tags.angleBracket],
107
+ color: base02
108
+ },
109
+ {
110
+ tag: [tags.attributeName],
111
+ color: base05
112
+ },
113
+ {
114
+ tag: [tags.regexp],
115
+ color: invalid
116
+ },
117
+ {
118
+ tag: [tags.quote],
119
+ color: base_green
120
+ },
121
+ { tag: [tags.string], color: base_yellow },
122
+ {
123
+ tag: tags.link,
124
+ color: base_cyan,
125
+ textDecoration: 'underline',
126
+ textUnderlinePosition: 'under'
127
+ },
128
+ {
129
+ tag: [tags.url, tags.escape, /*@__PURE__*/tags.special(tags.string)],
130
+ color: base_yellow
131
+ },
132
+ { tag: [tags.meta], color: base_red },
133
+ { tag: [tags.comment], color: base02, fontStyle: 'italic' },
134
+ { tag: tags.strong, fontWeight: 'bold', color: base06 },
135
+ { tag: tags.emphasis, fontStyle: 'italic', color: base_green },
136
+ { tag: tags.strikethrough, textDecoration: 'line-through' },
137
+ { tag: tags.heading, fontWeight: 'bold', color: base_yellow },
138
+ { tag: tags.heading1, fontWeight: 'bold', color: base07 },
139
+ {
140
+ tag: [tags.heading2, tags.heading3, tags.heading4],
141
+ fontWeight: 'bold',
142
+ color: base06
143
+ },
144
+ {
145
+ tag: [tags.heading5, tags.heading6],
146
+ color: base06
147
+ },
148
+ { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base_magenta },
149
+ {
150
+ tag: [tags.processingInstruction, tags.inserted, tags.contentSeparator],
151
+ color: base_red
152
+ },
153
+ {
154
+ tag: [tags.contentSeparator],
155
+ color: base_yellow
156
+ },
157
+ { tag: tags.invalid, color: base02, borderBottom: `1px dotted ${base_red}` }
158
+ ]);
159
+ /// Extension to enable the Solarized Dark theme (both the editor theme and
160
+ /// the highlight style).
161
+ const solarizedDark = [
162
+ solarizedDarkTheme,
163
+ /*@__PURE__*/syntaxHighlighting(solarizedDarkHighlightStyle)
164
+ ];
165
+
166
+ export { solarizedDark, solarizedDarkHighlightStyle, solarizedDarkTheme };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@fsegurai/codemirror-theme-solarized-dark",
3
+ "description": "Solarized Dark theme for the CodeMirror code editor",
4
+ "version": "6.0.1-alpha.0",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "exports": {
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs"
10
+ },
11
+ "types": "dist/index.d.ts",
12
+ "module": "dist/index.js",
13
+ "sideEffects": false,
14
+ "scripts": {
15
+ "test": "cm-runtests",
16
+ "prepare": "cm-buildhelper src/index.ts"
17
+ },
18
+ "keywords": [
19
+ "editor",
20
+ "code",
21
+ "codemirror"
22
+ ],
23
+ "author": {
24
+ "name": "Fabián Segura",
25
+ "url": "https://www.fsegurai.com/"
26
+ },
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/fsegurai/codemirror-themes.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/fsegurai/codemirror-themes/issues"
34
+ },
35
+ "homepage": "https://github.com/fsegurai/codemirror-themes#readme",
36
+ "peerDependencies": {
37
+ "@lezer/highlight": "^1.0.0",
38
+ "@codemirror/language": "^6.0.0",
39
+ "@codemirror/state": "^6.0.0",
40
+ "@codemirror/view": "^6.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@codemirror/buildhelper": "^1.0.1"
44
+ }
45
+ }