-
Notifications
You must be signed in to change notification settings - Fork 214
fix(nimbus): make boolean text more visible in dark mode in codemirror windows #13596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,29 @@ | ||
| import { basicSetup } from "codemirror"; | ||
| import { EditorView } from "@codemirror/view"; | ||
| import { | ||
| drawSelection, | ||
| EditorView, | ||
| highlightActiveLine, | ||
| highlightSpecialChars, | ||
| keymap, | ||
| lineNumbers, | ||
| } from "@codemirror/view"; | ||
| import { json, jsonParseLinter } from "@codemirror/lang-json"; | ||
| import { linter } from "@codemirror/lint"; | ||
| import { autocompletion } from "@codemirror/autocomplete"; | ||
| import { autocompletion, closeBrackets } from "@codemirror/autocomplete"; | ||
| import { | ||
| HighlightStyle, | ||
| syntaxHighlighting, | ||
| defaultHighlightStyle, | ||
| foldGutter, | ||
| bracketMatching, | ||
| indentOnInput, | ||
| } from "@codemirror/language"; | ||
| import { | ||
| highlightSelectionMatches, | ||
| searchKeymap, | ||
| search, | ||
| } from "@codemirror/search"; | ||
| import { defaultKeymap, historyKeymap, history } from "@codemirror/commands"; | ||
| import { tags } from "@lezer/highlight"; | ||
| import { schemaAutocomplete, schemaLinter } from "./validator.js"; | ||
| import $ from "jquery"; | ||
|
|
||
|
|
@@ -12,8 +33,26 @@ const setupCodemirror = (selector, textarea, extraExtensions) => { | |
| return; | ||
| } | ||
|
|
||
| const highlightStyle = HighlightStyle.define([ | ||
| { tag: tags.bool, color: "#ffaa00ff", themeType: "dark" }, | ||
| ]); | ||
|
|
||
| const extensions = [ | ||
| basicSetup, | ||
| lineNumbers(), | ||
| drawSelection(), | ||
| highlightSpecialChars(), | ||
| foldGutter(), | ||
| autocompletion(), | ||
| bracketMatching(), | ||
| closeBrackets(), | ||
| highlightSelectionMatches(), | ||
| indentOnInput(), | ||
| highlightActiveLine(), | ||
| syntaxHighlighting(highlightStyle), | ||
| syntaxHighlighting(defaultHighlightStyle), | ||
| history(), | ||
| search(), | ||
| keymap.of([...defaultKeymap, ...searchKeymap, ...historyKeymap]), | ||
|
Comment on lines
-16
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this is a bit hairy. If using dedicated light/dark themes is too complicated let's just go back to your original approach of just overriding the colour of the bools. Simplest, smallest solution is usually best 🙏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The approach i have here is only changing the colour of the boolean text. |
||
| EditorView.updateListener.of((v) => { | ||
| if (v.docChanged) { | ||
| const value = v.state.doc.toString(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.