@fsegurai/codemirror-theme-github-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,30 @@
1
+ <!-- NOTE: README.md is generated from src/README.md -->
2
+
3
+ # @fsegurai/codemirror-theme-github-light [![NPM version](https://img.shields.io/npm/v/@fsegurai/codemirror-theme-github-light.svg)](https://www.npmjs.org/package/@fsegurai/codemirror-theme-github-light)
4
+
5
+ [ [**WEBSITE**](https://codemirror.net/6/) | [**ISSUES**](https://github.com/codemirror/codemirror.next/issues) | [*
6
+ *FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG
7
+ **](https://github.com/codemirror/theme-one-dark/blob/main/CHANGELOG.md) ]
8
+
9
+ This package implements the GitHub Light theme for the
10
+ [CodeMirror](https://codemirror.net/6/) code editor.
11
+
12
+ The [project page](https://codemirror.net/6/) has more information, a
13
+ number of [examples](https://codemirror.net/6/examples/) and the
14
+ [documentation](https://codemirror.net/6/docs/).
15
+
16
+ This code is released under an
17
+ [MIT license](https://github.com/fsegurai/cm6-themes/tree/main/LICENSE).
18
+
19
+ We aim to be an inclusive, welcoming community. To make that explicit,
20
+ we have a [code of
21
+ conduct](http://contributor-covenant.org/version/1/1/0/) that applies
22
+ to communication around the project.
23
+
24
+ ## API Reference
25
+
26
+ @githubLight
27
+
28
+ @githubLightTheme
29
+
30
+ @githubLightHighlightStyle
package/dist/index.cjs ADDED
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ var view = require('@codemirror/view');
4
+ var language = require('@codemirror/language');
5
+ var highlight = require('@lezer/highlight');
6
+
7
+ // GitHub Light theme color definitions aligned with your schema
8
+ const base00 = '#fff', // Background
9
+ base01 = '#24292e', // Foreground
10
+ base02 = '#BBDFFF', // Selection and Selection Match
11
+ base03 = '#6e7781', // Gutter Foreground
12
+ base05 = '#116329', // TagName and Standard TagName
13
+ base06 = '#6a737d', // Comment and Bracket
14
+ base07 = '#6f42c1', // ClassName and PropertyName
15
+ base08 = '#005cc5', // VariableName, AttributeName, Number, Operator
16
+ base09 = '#d73a49', // Keyword, TypeName, TypeOperator
17
+ base0A = '#032f62', // String, Meta, Regexp
18
+ base0B = '#22863a', // Name, Quote
19
+ base0C = '#e36209', // Atom, Bool, Special VariableName
20
+ base0D = '#b31d28', // Deleted
21
+ base0E = '#ffeef0', // Background for Deleted
22
+ invalid = '#cb2431'; // Invalid color
23
+ const darkBackground = '#f6f8fa', // A lighter background for panels, assuming a light theme variant
24
+ highlightBackground = base02 + '20', // Adding opacity for highlight
25
+ tooltipBackground = base00, cursor = base01, selection = base02;
26
+ // Define the editor theme styles for GitHub Light.
27
+ const githubLightTheme = view.EditorView.theme({
28
+ '&': {
29
+ color: base01,
30
+ backgroundColor: base00
31
+ },
32
+ '.cm-content': {
33
+ caretColor: cursor
34
+ },
35
+ '.cm-cursor, .cm-dropCursor': {
36
+ borderLeftColor: cursor
37
+ },
38
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
39
+ backgroundColor: selection
40
+ },
41
+ '.cm-searchMatch': {
42
+ backgroundColor: base02,
43
+ outline: `1px solid ${base03}`
44
+ },
45
+ '.cm-searchMatch.cm-searchMatch-selected': {
46
+ backgroundColor: base05,
47
+ color: base07
48
+ },
49
+ '.cm-panels': {
50
+ backgroundColor: darkBackground,
51
+ color: base03
52
+ },
53
+ '.cm-panels.cm-panels-top': {
54
+ borderBottom: '2px solid black'
55
+ },
56
+ '.cm-panels.cm-panels-bottom': {
57
+ borderTop: '2px solid black'
58
+ },
59
+ '.cm-activeLine': {
60
+ backgroundColor: highlightBackground
61
+ },
62
+ '.cm-gutters': {
63
+ backgroundColor: base00,
64
+ color: base03
65
+ },
66
+ '.cm-tooltip': {
67
+ backgroundColor: tooltipBackground
68
+ }
69
+ }, { dark: false });
70
+ // Define the highlighting style for code in the GitHub Light theme.
71
+ const githubLightHighlightStyle = language.HighlightStyle.define([
72
+ { tag: [highlight.tags.standard(highlight.tags.tagName), highlight.tags.tagName], color: base05 },
73
+ { tag: [highlight.tags.comment, highlight.tags.bracket], color: base06 },
74
+ { tag: [highlight.tags.className, highlight.tags.propertyName], color: base07 },
75
+ { tag: [highlight.tags.variableName, highlight.tags.attributeName, highlight.tags.number, highlight.tags.operator], color: base08 },
76
+ { tag: [highlight.tags.keyword, highlight.tags.typeName, highlight.tags.typeOperator], color: base09 },
77
+ { tag: [highlight.tags.string, highlight.tags.meta, highlight.tags.regexp], color: base0A },
78
+ { tag: [highlight.tags.name, highlight.tags.quote], color: base0B },
79
+ { tag: [highlight.tags.heading, highlight.tags.strong], color: base01, fontWeight: 'bold' },
80
+ { tag: [highlight.tags.emphasis], color: base01, fontStyle: 'italic' },
81
+ { tag: [highlight.tags.deleted], color: base0D, backgroundColor: base0E },
82
+ { tag: [highlight.tags.atom, highlight.tags.bool, highlight.tags.special(highlight.tags.variableName)], color: base0C },
83
+ { tag: [highlight.tags.url, highlight.tags.escape, highlight.tags.regexp, highlight.tags.link], color: base0A },
84
+ { tag: highlight.tags.link, textDecoration: 'underline' },
85
+ { tag: highlight.tags.strikethrough, textDecoration: 'line-through' },
86
+ { tag: highlight.tags.invalid, color: invalid }
87
+ ]);
88
+ // Extension to enable the GitHub Light theme (both the editor theme and the highlight style).
89
+ const githubLight = [
90
+ githubLightTheme,
91
+ language.syntaxHighlighting(githubLightHighlightStyle)
92
+ ];
93
+
94
+ exports.githubLight = githubLight;
95
+ exports.githubLightHighlightStyle = githubLightHighlightStyle;
96
+ exports.githubLightTheme = githubLightTheme;
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const githubLightTheme: Extension;
5
+ declare const githubLightHighlightStyle: HighlightStyle;
6
+ declare const githubLight: Extension;
7
+
8
+ export { githubLight, githubLightHighlightStyle, githubLightTheme };
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+
4
+ declare const githubLightTheme: Extension;
5
+ declare const githubLightHighlightStyle: HighlightStyle;
6
+ declare const githubLight: Extension;
7
+
8
+ export { githubLight, githubLightHighlightStyle, githubLightTheme };
package/dist/index.js ADDED
@@ -0,0 +1,92 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+
5
+ // GitHub Light theme color definitions aligned with your schema
6
+ const base00 = '#fff', // Background
7
+ base01 = '#24292e', // Foreground
8
+ base02 = '#BBDFFF', // Selection and Selection Match
9
+ base03 = '#6e7781', // Gutter Foreground
10
+ base05 = '#116329', // TagName and Standard TagName
11
+ base06 = '#6a737d', // Comment and Bracket
12
+ base07 = '#6f42c1', // ClassName and PropertyName
13
+ base08 = '#005cc5', // VariableName, AttributeName, Number, Operator
14
+ base09 = '#d73a49', // Keyword, TypeName, TypeOperator
15
+ base0A = '#032f62', // String, Meta, Regexp
16
+ base0B = '#22863a', // Name, Quote
17
+ base0C = '#e36209', // Atom, Bool, Special VariableName
18
+ base0D = '#b31d28', // Deleted
19
+ base0E = '#ffeef0', // Background for Deleted
20
+ invalid = '#cb2431'; // Invalid color
21
+ const darkBackground = '#f6f8fa', // A lighter background for panels, assuming a light theme variant
22
+ highlightBackground = base02 + '20', // Adding opacity for highlight
23
+ tooltipBackground = base00, cursor = base01, selection = base02;
24
+ // Define the editor theme styles for GitHub Light.
25
+ const githubLightTheme = /*@__PURE__*/EditorView.theme({
26
+ '&': {
27
+ color: base01,
28
+ backgroundColor: base00
29
+ },
30
+ '.cm-content': {
31
+ caretColor: cursor
32
+ },
33
+ '.cm-cursor, .cm-dropCursor': {
34
+ borderLeftColor: cursor
35
+ },
36
+ '&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
37
+ backgroundColor: selection
38
+ },
39
+ '.cm-searchMatch': {
40
+ backgroundColor: base02,
41
+ outline: `1px solid ${base03}`
42
+ },
43
+ '.cm-searchMatch.cm-searchMatch-selected': {
44
+ backgroundColor: base05,
45
+ color: base07
46
+ },
47
+ '.cm-panels': {
48
+ backgroundColor: darkBackground,
49
+ color: base03
50
+ },
51
+ '.cm-panels.cm-panels-top': {
52
+ borderBottom: '2px solid black'
53
+ },
54
+ '.cm-panels.cm-panels-bottom': {
55
+ borderTop: '2px solid black'
56
+ },
57
+ '.cm-activeLine': {
58
+ backgroundColor: highlightBackground
59
+ },
60
+ '.cm-gutters': {
61
+ backgroundColor: base00,
62
+ color: base03
63
+ },
64
+ '.cm-tooltip': {
65
+ backgroundColor: tooltipBackground
66
+ }
67
+ }, { dark: false });
68
+ // Define the highlighting style for code in the GitHub Light theme.
69
+ const githubLightHighlightStyle = /*@__PURE__*/HighlightStyle.define([
70
+ { tag: [/*@__PURE__*/tags.standard(tags.tagName), tags.tagName], color: base05 },
71
+ { tag: [tags.comment, tags.bracket], color: base06 },
72
+ { tag: [tags.className, tags.propertyName], color: base07 },
73
+ { tag: [tags.variableName, tags.attributeName, tags.number, tags.operator], color: base08 },
74
+ { tag: [tags.keyword, tags.typeName, tags.typeOperator], color: base09 },
75
+ { tag: [tags.string, tags.meta, tags.regexp], color: base0A },
76
+ { tag: [tags.name, tags.quote], color: base0B },
77
+ { tag: [tags.heading, tags.strong], color: base01, fontWeight: 'bold' },
78
+ { tag: [tags.emphasis], color: base01, fontStyle: 'italic' },
79
+ { tag: [tags.deleted], color: base0D, backgroundColor: base0E },
80
+ { tag: [tags.atom, tags.bool, /*@__PURE__*/tags.special(tags.variableName)], color: base0C },
81
+ { tag: [tags.url, tags.escape, tags.regexp, tags.link], color: base0A },
82
+ { tag: tags.link, textDecoration: 'underline' },
83
+ { tag: tags.strikethrough, textDecoration: 'line-through' },
84
+ { tag: tags.invalid, color: invalid }
85
+ ]);
86
+ // Extension to enable the GitHub Light theme (both the editor theme and the highlight style).
87
+ const githubLight = [
88
+ githubLightTheme,
89
+ /*@__PURE__*/syntaxHighlighting(githubLightHighlightStyle)
90
+ ];
91
+
92
+ export { githubLight, githubLightHighlightStyle, githubLightTheme };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@fsegurai/codemirror-theme-github-light",
3
+ "description": "GitHub 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
+ }