Closed joelostblom closed 7 years ago
In CSS, ::before creates a pseudo-element that is the first child of the selected element.
https://developer.mozilla.org/en-US/docs/Web/CSS/::before
So .edit_mode .cell.selected::before .CodeMirror-focused:not(.cm-fat-cursor)
points wrong one while ::before
insert a pseudo-element.
Try .edit_mode .cell.selected .CodeMirror-focused:not(.cm-fat-cursor)
(I don't have a jupyter environment right now so I couldn't test it)
Thanks for your reply @lambdalisue.
I tried this
.edit_mode .cell.selected .CodeMirror-focused:not(.cm-fat-cursor) {
background-color: black !important;
}
But it only changes the color of the cell background when editing, not the vertical bar to the left of the cell.
I'm sorry I have mistaken.
You want to change the background-color
of .cell.selected::before
element via status of its child .cell.selected .CodeMirror-focused:not(.cm-fat-cursor)
.
However, there is no CSS selector which use child status (CSS4 introduce :has()
but I think most of browser has not support that selector yet).
Ref: https://stackoverflow.com/questions/38869401/filter-css-selector-based-on-child-properties
Too bad, thanks for letting me know!
It seems even 'has' won't work because it rely on neighbor not child.
One way to do that is adding class on it's parent by javascript.
Thanks @lambdalisue, so would I add this to my custom.js
? Do you have an example of what this would look like in my case? I tried adding a line to my custom.js
following this logic, but I can't get it to work.
Summary
The following in
custom.css
work as expected and change the color of the leftmost vertical bar when in jupyter and vim mode:However, I cannot figure out out to change the color to differentiate between vim normal and vim insert mode. I would expect this to be
But it is not working. I also tried adding
background-color: black !important;
without effect.This is unexpected to me, since I can use the following to change the background color of the cell without any problems:
Any ideas of how to change the color of the leftmost bar between vim normal and insert mode?
Environment