From 61716186bce5b4b597da9ec832075e7ea3592cac Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Mon, 28 Feb 2022 16:44:32 +0200
Subject: [PATCH] add selection styles

---
 .../src/Editoria/layout/EditorElements.js     | 35 +----------------
 .../src/Editoria/layout/EditoriaLayout.js     |  1 -
 .../demo/src/HHMI/layout/EditorElements.js    | 37 +-----------------
 .../demo/src/NCBI/layout/EditorElements.js    | 26 +------------
 wax-prosemirror-core/src/styles/styles.css    | 38 +++++++++++++++----
 .../multipleQuestionStyles.css                |  5 +++
 6 files changed, 39 insertions(+), 103 deletions(-)

diff --git a/editors/demo/src/Editoria/layout/EditorElements.js b/editors/demo/src/Editoria/layout/EditorElements.js
index 7d1b9a7f5..fbab00cdf 100644
--- a/editors/demo/src/Editoria/layout/EditorElements.js
+++ b/editors/demo/src/Editoria/layout/EditorElements.js
@@ -1,38 +1,5 @@
 import { css } from 'styled-components';
 
-import { th } from '@pubsweet/ui-toolkit';
-
 /* All styles regarding ProseMirror surface and elements */
 
-const fontWriting = css`
-  font-family: ${th('fontWriting')};
-  font-size: ${th('fontSizeBase')};
-  color: ${th('colorText')};
-`;
-
-export default css`
-  .ProseMirror {
-    background: white;
-    line-height: 1.6;
-    ${fontWriting}
-
-    p::selection,
-    h1::selection,
-    h2::selection,
-    h3::selection,
-    code::selection,
-    span::selection,
-    p span::selection,
-    h1 span::selection,
-    h2 span::selection,
-    h3 span::selection,
-    h4 span::selection,
-    code span::selection,
-    custom-tag-block::selection,
-    custom-tag-inline::selection,
-    #notes-container div::selection {
-      background-color: transparent;
-      color: #000;
-    }
-  }
-`;
+export default css``;
diff --git a/editors/demo/src/Editoria/layout/EditoriaLayout.js b/editors/demo/src/Editoria/layout/EditoriaLayout.js
index ee26f2e5a..3b4478111 100644
--- a/editors/demo/src/Editoria/layout/EditoriaLayout.js
+++ b/editors/demo/src/Editoria/layout/EditoriaLayout.js
@@ -157,7 +157,6 @@ const NotesAreaContainer = styled.div`
   overflow-y: scroll;
   position: absolute;
   /* PM styles  for note content*/
-  ${EditorElements};
   .ProseMirror {
     display: inline;
   }
diff --git a/editors/demo/src/HHMI/layout/EditorElements.js b/editors/demo/src/HHMI/layout/EditorElements.js
index d4e7f8f03..fbab00cdf 100644
--- a/editors/demo/src/HHMI/layout/EditorElements.js
+++ b/editors/demo/src/HHMI/layout/EditorElements.js
@@ -1,40 +1,5 @@
 import { css } from 'styled-components';
 
-import { th } from '@pubsweet/ui-toolkit';
-
-//import 'wax-prosemirror-core/dist/index.css';
-
 /* All styles regarding ProseMirror surface and elements */
 
-const fontWriting = css`
-  color: ${th('colorText')};
-  font-family: ${th('fontWriting')};
-  font-size: ${th('fontSizeBase')};
-`;
-
-export default css`
-  .ProseMirror {
-    background: white;
-    counter-reset: multiple-question;
-    line-height: 1.6;
-    ${fontWriting}
-
-    p::selection,
-    h1::selection,
-    h2::selection,
-    h3::selection,
-    code::selection,
-    span::selection,
-    p span::selection,
-    h1 span::selection,
-    h2 span::selection,
-    h3 span::selection,
-    h4 span::selection,
-    code span::selection,
-    custom-tag-block::selection,
-    custom-tag-inline::selection {
-      background-color: transparent;
-      color: #000;
-    }
-  }
-`;
+export default css``;
diff --git a/editors/demo/src/NCBI/layout/EditorElements.js b/editors/demo/src/NCBI/layout/EditorElements.js
index a81c5f4cd..6afafdfe4 100644
--- a/editors/demo/src/NCBI/layout/EditorElements.js
+++ b/editors/demo/src/NCBI/layout/EditorElements.js
@@ -10,28 +10,4 @@ const fontWriting = css`
   font-size: ${th('fontSizeBase')};
 `;
 
-export default css`
-  .ProseMirror {
-    background: white;
-    counter-reset: footnote;
-    line-height: 12px;
-    width: 497px;
-    white-space: pre !important;
-    overflow-x: auto;
-    ${fontWriting}
-
-    p::selection,
-    h1::selection,
-    h2::selection,
-    h3::selection,
-    code::selection,
-    span::selection,
-    p span::selection,
-    h1 span::selection,
-    h2 span::selection,
-    h3 span::selection,
-    code span::selection title::selection {
-      background-color: transparent;
-    }
-  }
-`;
+export default css``;
diff --git a/wax-prosemirror-core/src/styles/styles.css b/wax-prosemirror-core/src/styles/styles.css
index 25272c3f9..ef185effd 100644
--- a/wax-prosemirror-core/src/styles/styles.css
+++ b/wax-prosemirror-core/src/styles/styles.css
@@ -1,7 +1,12 @@
 /* Basic styles for proseMirror view and gapCursor */
 .ProseMirror {
+  background: #fff;
+  color: #111;
   font-feature-settings: 'liga' 0; /* the above doesn't seem to work in Edge */
+  font-family: 'Merriweather';
   font-variant-ligatures: none;
+  line-height: 1.6;
+  font-size: 14px;
   word-wrap: break-word;
   white-space: pre-wrap;
   white-space: break-spaces;
@@ -203,12 +208,6 @@ img.ProseMirror-separator {
     transform: rotate(40deg);
   }
 
-  /* Wax Selection Marker */
-    .ProseMirror .wax-selection-marker {
-    background-color: #C5D7FE;
-    opacity: 0.8;
-  }
-
   /* hr */ 
 
   hr {
@@ -223,4 +222,29 @@ img.ProseMirror-separator {
     height: 1px;
     background-color: silver;
     line-height: 2px;
-  }
\ No newline at end of file
+  }
+
+    /* Wax Selection Marker */
+    .ProseMirror .wax-selection-marker {
+    background-color: #C5D7FE;
+    opacity: 0.8;
+  }
+
+  .ProseMirror p::selection,
+   .ProseMirror h1::selection,
+   .ProseMirror h2::selection,
+   .ProseMirror h3::selection,
+   .ProseMirror code::selection,
+   .ProseMirror span::selection,
+   .ProseMirror p span::selection,
+   .ProseMirror h1 span::selection,
+   .ProseMirror h2 span::selection,
+   .ProseMirror h3 span::selection,
+   .ProseMirror h4 span::selection,
+   .ProseMirror code span::selection,
+   .ProseMirror custom-tag-block::selection,
+   .ProseMirror custom-tag-inline::selection,
+    #notes-container div::selection {
+      background-color: transparent;
+      color: #000;
+    }
\ No newline at end of file
diff --git a/wax-prosemirror-services/src/MultipleChoiceQuestionService/multipleQuestionStyles.css b/wax-prosemirror-services/src/MultipleChoiceQuestionService/multipleQuestionStyles.css
index a5a407fe1..92f6e1608 100644
--- a/wax-prosemirror-services/src/MultipleChoiceQuestionService/multipleQuestionStyles.css
+++ b/wax-prosemirror-services/src/MultipleChoiceQuestionService/multipleQuestionStyles.css
@@ -1,4 +1,9 @@
   /* -- Multiple Choice ---------------------------------- */
+
+.ProseMirror {
+  counter-reset: multiple-question;
+}
+
 .multiple-choice,
 .multiple-choice-single-correct,
 .true-false,
-- 
GitLab