Skip to content

Commit 84dadb1

Browse files
committed
Add a white background to the default light theme.
This is needed if a page is in dark mode. Also fix an npm security vulnerability. The version is bumped so that this can be published.
1 parent 2c52606 commit 84dadb1

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openwebwork/pg-codemirror-editor",
3-
"version": "0.0.6",
3+
"version": "0.0.8",
44
"description": "PG CodeMirror Editor",
55
"author": "The WeBWorK Project",
66
"license": "MIT",

src/light-theme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { tags as t } from '@lezer/highlight';
2+
import { EditorView } from '@codemirror/view';
23
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
34

5+
const lightEditorTheme = EditorView.theme({ '&': { backgroundColor: 'white' } }, { dark: false });
6+
47
export const lightHighlightStyle = HighlightStyle.define([
58
{ tag: t.meta, color: '#404740' },
69
{ tag: t.link, textDecoration: 'underline' },
@@ -25,4 +28,4 @@ export const lightHighlightStyle = HighlightStyle.define([
2528
{ tag: t.invalid, color: '#f00' }
2629
]);
2730

28-
export const lightTheme = syntaxHighlighting(lightHighlightStyle, { fallback: true });
31+
export const lightTheme = [lightEditorTheme, syntaxHighlighting(lightHighlightStyle, { fallback: true })];

0 commit comments

Comments
 (0)