@fsegurai/codemirror-theme-solarized-light 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-light.svg)](https://www.npmjs.org/package/@fsegurai/codemirror-theme-solarized-light)
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 Light 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
+ @solarizedLight
25
+
26
+ @solarizedLightTheme
27
+
28
+ @solarizedLightHighlightStyle
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 = '#657b83', base01 = '#586e75', base02 = '#073642', base03 = '#002b36', base1 = '#93a1a1', base3 = '#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', darkBackground = '#dfd9c8', highlightBackground = darkBackground, background = base3, tooltipBackground = base01, selection = darkBackground, cursor = base01;
9
+ /// The editor theme styles for Solarized Light.
10
+ const solarizedLightTheme = view.EditorView.theme({
11
+ '&': {
12
+ color: base00,
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 ${base1}`
34
+ },
35
+ '.cm-gutters': {
36
+ backgroundColor: '#00000010',
37
+ color: base00,
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: false });
67
+ /// The highlighting style for code in the Solarized Light theme.
68
+ const solarizedLightHighlightStyle = 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: base_blue },
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: base1
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: base01 },
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: base03 },
141
+ {
142
+ tag: [highlight.tags.heading2, highlight.tags.heading3, highlight.tags.heading4],
143
+ fontWeight: 'bold',
144
+ color: base03
145
+ },
146
+ {
147
+ tag: [highlight.tags.heading5, highlight.tags.heading6],
148
+ color: base03
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 Light theme (both the editor theme and
162
+ /// the highlight style).
163
+ const solarizedLight = [
164
+ solarizedLightTheme,
165
+ language.syntaxHighlighting(solarizedLightHighlightStyle)
166
+ ];
167
+
168
+ exports.solarizedLight = solarizedLight;
169
+ exports.solarizedLightHighlightStyle = solarizedLightHighlightStyle;
170
+ exports.solarizedLightTheme = solarizedLightTheme;
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const solarizedLightTheme: Extension;
5
+ declare const solarizedLightHighlightStyle: HighlightStyle;
6
+ declare const solarizedLight: Extension;
7
+
8
+ export { solarizedLight, solarizedLightHighlightStyle, solarizedLightTheme };
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const solarizedLightTheme: Extension;
5
+ declare const solarizedLightHighlightStyle: HighlightStyle;
6
+ declare const solarizedLight: Extension;
7
+
8
+ export { solarizedLight, solarizedLightHighlightStyle, solarizedLightTheme };
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 = '#657b83', base01 = '#586e75', base02 = '#073642', base03 = '#002b36', base1 = '#93a1a1', base3 = '#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', darkBackground = '#dfd9c8', highlightBackground = darkBackground, background = base3, tooltipBackground = base01, selection = darkBackground, cursor = base01;
7
+ /// The editor theme styles for Solarized Light.
8
+ const solarizedLightTheme = /*@__PURE__*/EditorView.theme({
9
+ '&': {
10
+ color: base00,
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 ${base1}`
32
+ },
33
+ '.cm-gutters': {
34
+ backgroundColor: '#00000010',
35
+ color: base00,
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: false });
65
+ /// The highlighting style for code in the Solarized Light theme.
66
+ const solarizedLightHighlightStyle = /*@__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: base_blue },
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: base1
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: base01 },
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: base03 },
139
+ {
140
+ tag: [tags.heading2, tags.heading3, tags.heading4],
141
+ fontWeight: 'bold',
142
+ color: base03
143
+ },
144
+ {
145
+ tag: [tags.heading5, tags.heading6],
146
+ color: base03
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 Light theme (both the editor theme and
160
+ /// the highlight style).
161
+ const solarizedLight = [
162
+ solarizedLightTheme,
163
+ /*@__PURE__*/syntaxHighlighting(solarizedLightHighlightStyle)
164
+ ];
165
+
166
+ export { solarizedLight, solarizedLightHighlightStyle, solarizedLightTheme };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@fsegurai/codemirror-theme-solarized-light",
3
+ "description": "Solarized Light 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
+ }