ソースを参照

fix up handling of codemirror

Steven Silvester 4 年 前
コミット
b310c50709

+ 0 - 115
packages/codemirror/style/base.css

@@ -1,115 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-.CodeMirror {
-  line-height: var(--jp-code-line-height);
-  font-size: var(--jp-code-font-size);
-  font-family: var(--jp-code-font-family);
-  border: 0;
-  border-radius: 0;
-  height: auto;
-  /* Changed to auto to autogrow */
-}
-
-.CodeMirror pre {
-  padding: 0 var(--jp-code-padding);
-}
-
-:host([data-type='inline']) .CodeMirror-dialog {
-  background-color: var(--jp-layout-color0);
-  color: var(--jp-content-font-color1);
-}
-
-/* This causes https://github.com/jupyter/jupyterlab/issues/522 */
-/* May not cause it not because we changed it! */
-.CodeMirror-lines {
-  padding: var(--jp-code-padding) 0;
-}
-
-.CodeMirror-linenumber {
-  padding: 0 8px;
-}
-
-:host {
-  cursor: text;
-}
-
-:host([data-type='inline']) .CodeMirror-cursor {
-  border-left: var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color);
-}
-
-/* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */
-@media screen and (min-width: 2138px) and (max-width: 4319px) {
-  :host([data-type='inline']) .CodeMirror-cursor {
-    border-left: var(--jp-code-cursor-width1) solid
-      var(--jp-editor-cursor-color);
-  }
-}
-
-/* When zoomed out less than 33% */
-@media screen and (min-width: 4320px) {
-  :host([data-type='inline']) .CodeMirror-cursor {
-    border-left: var(--jp-code-cursor-width2) solid
-      var(--jp-editor-cursor-color);
-  }
-}
-
-.CodeMirror.jp-mod-readOnly .CodeMirror-cursor {
-  display: none;
-}
-
-.CodeMirror-gutters {
-  border-right: 1px solid var(--jp-border-color2);
-  background-color: var(--jp-layout-color0);
-}
-
-.jp-CollaboratorCursor {
-  border-left: 5px solid transparent;
-  border-right: 5px solid transparent;
-  border-top: none;
-  border-bottom: 3px solid;
-  background-clip: content-box;
-  margin-left: -5px;
-  margin-right: -5px;
-}
-
-.CodeMirror-selectedtext.cm-searching {
-  background-color: var(--jp-search-selected-match-background-color) !important;
-  color: var(--jp-search-selected-match-color) !important;
-}
-
-.cm-searching {
-  background-color: var(
-    --jp-search-unselected-match-background-color
-  ) !important;
-  color: var(--jp-search-unselected-match-color) !important;
-}
-
-.CodeMirror-focused .CodeMirror-selected {
-  background-color: var(--jp-editor-selected-focused-background);
-}
-
-.CodeMirror-selected {
-  background-color: var(--jp-editor-selected-background);
-}
-
-.jp-CollaboratorCursor-hover {
-  position: absolute;
-  z-index: 1;
-  transform: translateX(-50%);
-  color: white;
-  border-radius: 3px;
-  padding-left: 4px;
-  padding-right: 4px;
-  padding-top: 1px;
-  padding-bottom: 1px;
-  text-align: center;
-  font-size: var(--jp-ui-font-size1);
-  white-space: nowrap;
-}
-
-.jp-CodeMirror-ruler {
-  border-left: 1px dashed var(--jp-border-color2);
-}

+ 0 - 5
packages/codemirror/style/index.css

@@ -8,8 +8,3 @@
 @import url('~@jupyterlab/apputils/style/index.css');
 @import url('~@jupyterlab/codeeditor/style/index.css');
 @import url('~@jupyterlab/statusbar/style/index.css');
-@import url('~codemirror/lib/codemirror.css');
-@import url('~codemirror/addon/dialog/dialog.css');
-@import url('~codemirror/addon/fold/foldgutter.css');
-
-@import url('./base.css');

+ 110 - 1
packages/codemirror/style/shadow.css

@@ -7,4 +7,113 @@
 @import url('~codemirror/addon/dialog/dialog.css');
 @import url('~codemirror/addon/fold/foldgutter.css');
 
-@import url('./base.css');
+.CodeMirror {
+  line-height: var(--jp-code-line-height);
+  font-size: var(--jp-code-font-size);
+  font-family: var(--jp-code-font-family);
+  border: 0;
+  border-radius: 0;
+  height: auto;
+  /* Changed to auto to autogrow */
+}
+
+.CodeMirror pre {
+  padding: 0 var(--jp-code-padding);
+}
+
+:host([data-type='inline']) .CodeMirror-dialog {
+  background-color: var(--jp-layout-color0);
+  color: var(--jp-content-font-color1);
+}
+
+/* This causes https://github.com/jupyter/jupyterlab/issues/522 */
+/* May not cause it not because we changed it! */
+.CodeMirror-lines {
+  padding: var(--jp-code-padding) 0;
+}
+
+.CodeMirror-linenumber {
+  padding: 0 8px;
+}
+
+:host {
+  cursor: text;
+}
+
+:host([data-type='inline']) .CodeMirror-cursor {
+  border-left: var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color);
+}
+
+/* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */
+@media screen and (min-width: 2138px) and (max-width: 4319px) {
+  :host([data-type='inline']) .CodeMirror-cursor {
+    border-left: var(--jp-code-cursor-width1) solid
+      var(--jp-editor-cursor-color);
+  }
+}
+
+/* When zoomed out less than 33% */
+@media screen and (min-width: 4320px) {
+  :host([data-type='inline']) .CodeMirror-cursor {
+    border-left: var(--jp-code-cursor-width2) solid
+      var(--jp-editor-cursor-color);
+  }
+}
+
+.CodeMirror.jp-mod-readOnly .CodeMirror-cursor {
+  display: none;
+}
+
+.CodeMirror-gutters {
+  border-right: 1px solid var(--jp-border-color2);
+  background-color: var(--jp-layout-color0);
+}
+
+.jp-CollaboratorCursor {
+  border-left: 5px solid transparent;
+  border-right: 5px solid transparent;
+  border-top: none;
+  border-bottom: 3px solid;
+  background-clip: content-box;
+  margin-left: -5px;
+  margin-right: -5px;
+}
+
+.CodeMirror-selectedtext.cm-searching {
+  background-color: var(--jp-search-selected-match-background-color) !important;
+  color: var(--jp-search-selected-match-color) !important;
+}
+
+.cm-searching {
+  background-color: var(
+    --jp-search-unselected-match-background-color
+  ) !important;
+  color: var(--jp-search-unselected-match-color) !important;
+}
+
+.CodeMirror-focused .CodeMirror-selected {
+  background-color: var(--jp-editor-selected-focused-background);
+}
+
+.CodeMirror-selected {
+  background-color: var(--jp-editor-selected-background);
+}
+
+.jp-CollaboratorCursor-hover {
+  position: absolute;
+  z-index: 1;
+  transform: translateX(-50%);
+  color: white;
+  border-radius: 3px;
+  padding-left: 4px;
+  padding-right: 4px;
+  padding-top: 1px;
+  padding-bottom: 1px;
+  text-align: center;
+  font-size: var(--jp-ui-font-size1);
+  white-space: nowrap;
+}
+
+.jp-CodeMirror-ruler {
+  border-left: 1px dashed var(--jp-border-color2);
+}