StS
September 17, 2023, 12:48pm
1
Hello Forum,
how do I have access to the used classes / colors within codemirror-6?
The mentioned colors in Colors are not listed in my TW palette manager.
(see also Need help to set color of marked/selected text in CodeMirror )
I’d like to change the color of (blinking) cursor and of curled brackets (different color, no border…)
and the the pulldown (background, border…):
(using F12 → click within → pulldown disappears)
Thanks
Stefan
Hi @StS
The codemirror 6 plugin uses its <<colour-extend>> macro, not the core <<colour>> macro.
The reason why is, that the CSS classes used in the editor are not defined in the various core palettes.
But don’t worry, the <<colour-extend>> macro has you covered:
it looks for a tiddler name that starts with the used palette (like $:/palettes/Twilight) and the suffix /extend - so it would be $:/palettes/Twilight/extend
set the type of that tiddler to application/x-tiddler-dictionary
in that tiddler, define colors for the classes you find in the Colors tiddler
Tell me if you need more styling options, then I will expose them
StS
September 17, 2023, 1:56pm
3
Hi @BurningTreeC ,
thanks for feedback.
I see - but the style of cursor and the curled brackets aro not in the used patette (like $:/palettes/Twilight) and than also not in the $:/palettes/Twilight/extend.
How do I adress this one?
Hi @StS
An updated version is online
Do the following:
clone the tiddler $:/palettes/Vanilla/extend
rename it to $:/palettes/Twilight/extend
change the colors of cm-caret-colour and cm-matching-bracket-outline
cm-matching-bracket-outline can also be transparent - if you want that
StS
September 17, 2023, 3:40pm
6
Hi @BurningTreeC ,
thanks - I got it.
And how can I style the cursor (more bright and thick/heavy)?
Hi @StS
you’ll need to add a new Stylesheet tiddler for that:
.cm-cursor, .cm-dropCursor {
border-left: 3px solid !important;
}
StS
September 19, 2023, 1:38pm
9
Hi @BurningTreeC ,
what font is used in codemirror-6?
The output of the cm-tooltip in the pulldown has fifferent font:
Any idea?
Thanks
Stefan
Oh, good catch @StS
the tooltip probably uses monospace
I will change its CSS so that it matches the font of the editor!
@StS - for now you can just add some CSS:
.cm-tooltip-autocomplete, .cm-tooltip-autocomplete > ul > li {
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}} !important;
}
StS
September 20, 2023, 7:49am
12
Perfect - thanks a lot!
→ Edit:
this generates an additional scrollbar
Oh, ok @StS - I will have a look at the additional scrollbar
@StS
could you please test if it works correctly if you add the following styles INSTEAD of the ones I posted?
.cm-tooltip-autocomplete > ul > li {
font-family: {{$:/themes/tiddlywiki/vanilla/settings/editorfontfamily}} !important;
overflow: hidden;
}
StS
September 20, 2023, 8:16am
15
@BurningTreeC
now it is perfect - thanks again!
StS
September 26, 2023, 4:27pm
16
Hi @BurningTreeC ,
where is the fish configured and how can that be changed / styled?
Thanks, Stefan
Hi @StS
I’ll change this configuration, maybe I’ll make it configurable
Best wishes,
Simon
StS
October 10, 2023, 9:25am
18
Hello @BurningTreeC ,
what is the correct parameter to set the color/background-color for the hover-effect working with the mouse?
Selection with the keyboard is working fine:
Thanks, Stefan
Hello @StS
use the following in a stylesheet tiddler:
.cm-tooltip-autocomplete > ul > li:hover {
background-color: <<colour-extend cm-tooltip-selected-background>> !important;
color: <<colour-extend cm-tooltip-selected-foreground>> !important;
}
StS
October 13, 2023, 5:24am
20
Thanks, @BurningTreeC - perfect!