As I try to implement the selected text styles in the markdown editor, I copied the selectors from the Joplin built in dark theme, and paste it to userchrome.css
, then, edited them to fit my excepted:
#react-root .CodeMirror-selectedtext {
color: var(--me-selected-text) !important;
}
#react-root .CodeMirror-selected {
background: var(--me-selected-bg) !important;
}
#react-root .CodeMirror-line::selection,
#react-root .CodeMirror-line > span::selection,
#react-root .CodeMirror-line > span > span::selection {
background: var(--me-selected-bg) !important;
}
#react-root .CodeMirror-line::-moz-selection,
#react-root .CodeMirror-line > span::-moz-selection,
#react-root .CodeMirror-line > span > span::-moz-selection {
background: var(--me-selected-bg) !important;
}
#react-root .CodeMirror-focused .CodeMirror-selected {
background: var(--me-selected-bg-focused) !important;
}
But there is only .CodeMirror-selectedtext
that can be applied to all users, but I'm curious about why the ::selection
and .CodeMirror-selected
both didn't work for some users?
Can someone tell me what's the exact problem here?