diff --git a/front_end/cm/README.md b/front_end/cm/README.md new file mode 100644 index 0000000000..890defe552 --- /dev/null +++ b/front_end/cm/README.md @@ -0,0 +1,3 @@ +Treat `codemirror.css` like a rolled-in upstream dependency. Instead of changing it directly, consider changing `front_end/text_editor/cmdevtools.css` instead. + +[Issue #1076825](https://bugs.chromium.org/p/chromium/issues/detail?id=1076825) tracks the effort to use the upstream file more directly. diff --git a/front_end/cm/codemirror.css b/front_end/cm/codemirror.css index c95ec0a422..1dcac08195 100644 --- a/front_end/cm/codemirror.css +++ b/front_end/cm/codemirror.css @@ -191,8 +191,6 @@ div.CodeMirror-dragcursors { .cm-tab-wrap-hack:after { content: ''; } /* Help users use markselection to safely style text background */ -span.CodeMirror-selectedtext { background: none; } - -.-theme-with-dark-background span.CodeMirror-selectedtext { - background: #000; +span.CodeMirror-selectedtext { + background: none; } diff --git a/front_end/text_editor/cmdevtools.css b/front_end/text_editor/cmdevtools.css index b01e194a1d..50ee2bc912 100644 --- a/front_end/text_editor/cmdevtools.css +++ b/front_end/text_editor/cmdevtools.css @@ -628,6 +628,11 @@ div.CodeMirror:focus-within span.CodeMirror-nonmatchingbracket { background-color: #454545; } +.-theme-with-dark-background span.CodeMirror-selectedtext, +:host-context(.-theme-with-dark-background) span.CodeMirror-selectedtext { + background: #000; +} + .CodeMirror .auto-complete-text { color: rgb(128 128 128); }