From a89c3207573c927305ec10f7639c7a4d7bc7988e Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 24 Jan 2019 17:13:51 -0500 Subject: [PATCH] move and fix theme specific css (#649) --- components/Carbon.js | 23 ----------------------- components/Themes/index.js | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index e688b4b..e2c91b7 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -171,29 +171,6 @@ class Carbon extends React.PureComponent { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==); } - /* TODO move the theme specific styles out of this component */ - .container :global(.cm-s-dracula .CodeMirror-cursor) { - border-left: solid 2px #159588; - } - - .container :global(.cm-s-solarized) { - box-shadow: none; - } - - .container :global(.cm-s-solarized.cm-s-light .CodeMirror-linenumber), - .container :global(.cm-s-solarized.cm-s-light .CodeMirror-linenumbers) { - background-color: #fdf6e3 !important; - } - - .container :global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumber), - .container :global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumbers) { - background-color: #002b36 !important; - } - - .container :global(.cm-s-solarized.cm-s-light) { - text-shadow: #eee8d5 0 1px; - } - .container :global(.CodeMirror-gutters) { background-color: unset; border-right: none; diff --git a/components/Themes/index.js b/components/Themes/index.js index 44d35a7..b8d148f 100644 --- a/components/Themes/index.js +++ b/components/Themes/index.js @@ -188,7 +188,7 @@ class Themes extends React.PureComponent { position: relative; } - :global(.react-codemirror2 .CodeMirror) { + :global(.CodeMirror__container .CodeMirror) { color: ${highlights.text} !important; background-color: ${highlights.background} !important; } @@ -226,6 +226,28 @@ class Themes extends React.PureComponent { :global(.cm-attribute) { color: ${highlights.attribute} !important; } + + :global(.cm-s-dracula .CodeMirror-cursor) { + border-left: solid 2px #159588 !important; + } + + :global(.cm-s-solarized) { + box-shadow: none !important; + } + + :global(.cm-s-solarized.cm-s-light) { + text-shadow: #eee8d5 0 1px !important; + } + + :global(.cm-s-solarized.cm-s-light .CodeMirror-linenumber), + :global(.cm-s-solarized.cm-s-light .CodeMirror-linenumbers) { + background-color: #fdf6e3 !important; + } + + :global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumber), + :global(.cm-s-solarized.cm-s-dark .CodeMirror-linenumbers) { + background-color: #002b36 !important; + } `}