Skip to content
Merged
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
2 changes: 2 additions & 0 deletions packages/components/react/src/CodeMirrorEditor/cm-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ export const editorTheme = EditorView.theme({
'.cm-tooltip': {
background: 'var(--cm-tooltip-backgroundColor)',
borderColor: 'var(--cm-tooltip-borderColor)',
color: 'var(--cm-tooltip-textColor)',
},
'.cm-tooltip.cm-tooltip-autocomplete ul li[aria-selected]': {
background: 'var(--cm-tooltip-backgroundColorSelected)',
color: 'var(--cm-tooltip-textColorSelected)',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not possible to set the text color for the text in the tooltip.

},
});

Expand Down
12 changes: 7 additions & 5 deletions packages/components/react/src/styles/cm.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

/* Cursor */
--cm-cursor-width: 2px;
--cm-cursor-backgroundColor: var(--tk-elements-editor-cursor-textColor, var(--tk-text-primary));
--cm-cursor-backgroundColor: var(--tk-elements-editor-cursorColor, var(--tk-text-primary));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, cursorColor makes more sense.


/* Matching Brackets */
--cm-matching-bracket: var(--tk-elements-editor-matchingBracketBackgroundColor, rgb(50 140 130 / 0.3));

/* Selection */
--cm-selection-backgroundColorFocused: var(--tk-elements-editor-selection-backgroundColorFocused, #42b4ff);
--cm-selection-backgroundOpacityFocused: var(--tk-elements-editor-selection-backgroundOpacityFocused, 0.3);
--cm-selection-backgroundColorBlured: var(--tk-elements-editor-selection-backgroundColorBlured, #c9e9ff);
--cm-selection-backgroundOpacityBlured: var(--tk-elements-editor-selection-backgroundOpacityBlured, 0.3);
--cm-selection-backgroundColorFocused: var(--tk-elements-editor-selection-backgroundColor, #42b4ff);
--cm-selection-backgroundOpacityFocused: var(--tk-elements-editor-selection-backgroundOpacity, 0.3);
--cm-selection-backgroundColorBlured: var(--tk-elements-editor-selection-inactiveBackgroundColor, #c9e9ff);
--cm-selection-backgroundOpacityBlured: var(--tk-elements-editor-selection-inactiveBackgroundOpacity, 0.3);
Comment on lines +25 to +28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed these to match a bit closer to how the terminal does the styling for the selection (--tk-elements-terminal-selection-backgroundColor). And renamed blured to inactive which matches more closely with others which we named activeBackgroundColor for instance.

Feel free to make suggestions, or we can also revert them.


/* Panels */
--cm-panels-borderColor: var(--tk-elements-editor-panels-borderColor, var(--tk-elements-app-borderColor));
Expand Down Expand Up @@ -77,10 +77,12 @@
--tk-elements-editor-tooltip-backgroundColor,
var(--tk-elements-app-backgroundColor)
);
--cm-tooltip-textColor: var(--tk-elements-editor-tooltip-textColor, var(--tk-text-primary));
--cm-tooltip-backgroundColorSelected: var(
--tk-elements-editor-tooltip-backgroundColorSelected,
var(--tk-background-accent)
);
--cm-tooltip-textColorSelected: var(--tk-elements-editor-tooltip-textColorSelected, var(--tk-text-primary));
--cm-tooltip-borderColor: var(--tk-elements-editor-tooltip-borderColor, var(--tk-elements-app-borderColor));
}

Expand Down