Skip to content
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

Update syntax highlighting colors #3017

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions frontend/components/CellInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,18 @@ window.PLUTO_TOGGLE_CM_AUTOCOMPLETE_ON_TYPE = (val = !ENABLE_CM_AUTOCOMPLETE_ON_
const common_style_tags = [
{ tag: tags.comment, color: "var(--cm-color-comment)", fontStyle: "italic", filter: "none" },
{ tag: tags.keyword, color: "var(--cm-color-keyword)" },
{ tag: tags.variableName, color: "var(--cm-color-var)", fontWeight: 700 },
{ tag: tags.typeName, color: "var(--cm-color-type)", fontStyle: "italic" },
{ tag: tags.typeOperator, color: "var(--cm-color-type)", fontStyle: "italic" },
{ tag: tags.variableName, color: "var(--cm-color-variable)", fontWeight: 700 },
{ tag: tags.typeName, filter: "var(--cm-filter-type)" },
{ tag: tags.tagName, color: "var(--cm-color-tag)" }, // JS
{ tag: tags.propertyName, color: "var(--cm-color-property)" },
{ tag: tags.propertyName, color: "var(--cm-color-symbol)", fontWeight: 700 },
// TODO: tags.labelName
{ tag: tags.macroName, color: "var(--cm-color-macro)", fontWeight: 700 },
{ tag: tags.string, color: "var(--cm-color-string)" },
// TODO: tags.character
{ tag: tags.number, color: "var(--cm-color-number)" },
{ tag: tags.bool, color: "var(--cm-color-builtin)", fontWeight: 700 },
// TODO: tags.escape
{ tag: tags.special(tags.string), color: "var(--cm-color-command)" },
{ tag: tags.character, color: "var(--cm-color-literal)" },
{ tag: tags.literal, color: "var(--cm-color-literal)" },
// TODO: tags.self, tags.null
{ tag: tags.atom, color: "var(--cm-color-atom)" },
{ tag: tags.unit, color: "var(--cm-color-tag)" }, // TODO: Remove
{ tag: tags.atom, color: "var(--cm-color-symbol)" },
// TODO? tags.operator
{ tag: tags.bracket, color: "var(--cm-color-bracket)" },
{ tag: tags.special(tags.brace), color: "var(--cm-color-macro)", fontWeight: 700 }, // interp
Expand Down
8 changes: 4 additions & 4 deletions frontend/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -3499,7 +3499,7 @@ pluto-cell.errored .cm-editor .cm-lineNumbers .cm-gutterElement::after {
}

.cm-completionIcon-c_Number::before {
color: var(--cm-color-number);
color: var(--cm-color-literal);
}

.cm-completionIcon-c_String::before,
Expand All @@ -3509,7 +3509,7 @@ pluto-cell.errored .cm-editor .cm-lineNumbers .cm-gutterElement::after {
}

.cm-completionIcon-completion_property::before {
color: var(--cm-color-property);
color: var(--cm-color-symbol);
}

.cm-completionIcon-completion_keyword::before {
Expand All @@ -3521,13 +3521,13 @@ li.completion_keyword_argument .cm-completionLabel {
font-weight: bold;
}
.cm-completionIcon-completion_keyword_argument::before {
color: var(--cm-color-number);
color: var(--cm-color-literal);
}

.cm-completionIcon-c_Any::before,
pluto-output > assignee,
pluto-popup code.auto_disabled_variable {
color: var(--cm-color-var) !important;
color: var(--cm-color-variable) !important;
font-weight: 700;
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/highlightjs.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ code.hljs {
.hljs-template-variable,
.hljs-type,
.hljs-variable {
color: var(--cm-color-var);
color: var(--cm-color-variable);
}
.hljs-number {
color: var(--cm-color-number);
color: var(--cm-color-literal);
}
.hljs-bullet,
.hljs-link,
Expand Down
7 changes: 3 additions & 4 deletions frontend/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,11 @@
/* code highlighting */
--cm-color-editor-text: #ffe9fc;
--cm-color-comment: #e96ba8;
--cm-color-atom: hsl(8deg 72% 62%);
--cm-color-number: hsl(271deg 45% 64%);
--cm-color-property: #f99b15;
--cm-color-symbol: #f99b15;
--cm-color-literal: hsl(271deg 45% 64%);
--cm-color-keyword: #ff7a6f;
--cm-color-string: hsl(20deg 69% 59%);
--cm-color-var: #afb7d3;
--cm-color-variable: #afb7d3;
--cm-color-var2: #06b6ef;
--cm-color-macro: #82b38b;
--cm-color-builtin: #5e7ad3;
Expand Down
20 changes: 11 additions & 9 deletions frontend/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,20 @@

/* code highlighting */
--cm-color-editor-text: #41323f;
--cm-color-comment: #e96ba8;
--cm-color-atom: #815ba4;
--cm-color-number: #815ba4;
--cm-color-property: #b67a48;
--cm-color-keyword: #ef6155;
--cm-color-string: #da5616;
--cm-color-var: #5668a4;
--cm-color-comment: #b62a66;
--cm-color-keyword: #b13e30;
--cm-color-symbol: #9b570d;
--cm-color-command: #607020;
--cm-color-macro: #327644;
--cm-color-string: #3a727b;
--cm-color-variable: #5466a5;
--cm-color-literal: #8e5189;
--cm-filter-type: brightness(150%) saturate(50%);;

/* The colors below are not used in CellInput.js */
--cm-color-var2: #37768a;
--cm-color-macro: #5c8c5f;
--cm-color-builtin: #5e7ad3;
--cm-color-function: #cc80ac;
--cm-color-type: hsl(170deg 7% 56%);
--cm-color-bracket: #41323f;
--cm-color-tag: #ef6155;
--cm-color-link: #815ba4;
Expand Down
Loading