From 04dfcabd7e90925790da1a9866759dd3b413bc2e Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Sat, 12 Mar 2022 10:09:50 +0200 Subject: [PATCH] fix styling --- .../src/Editoria/layout/EditorElements.js | 13 ++++- .../demo/src/HHMI/layout/EditorElements.js | 13 ++++- .../demo/src/NCBI/layout/EditorElements.js | 3 +- .../src/NCBI/layout/EditorMiniElements.js | 54 ------------------- wax-prosemirror-core/src/styles/styles.css | 2 +- .../src/NoteService/Editor.js | 2 +- 6 files changed, 28 insertions(+), 59 deletions(-) diff --git a/editors/demo/src/Editoria/layout/EditorElements.js b/editors/demo/src/Editoria/layout/EditorElements.js index fbab00cdf..25b06611e 100644 --- a/editors/demo/src/Editoria/layout/EditorElements.js +++ b/editors/demo/src/Editoria/layout/EditorElements.js @@ -1,5 +1,16 @@ import { css } from 'styled-components'; +import { th } from '@pubsweet/ui-toolkit'; /* All styles regarding ProseMirror surface and elements */ -export default css``; +const fontWriting = css` + color: ${th('colorText')}; + font-family: ${th('fontWriting')}; + font-size: ${th('fontSizeBase')}; +`; + +export default css` + .ProseMirror { + ${fontWriting} + } +`; diff --git a/editors/demo/src/HHMI/layout/EditorElements.js b/editors/demo/src/HHMI/layout/EditorElements.js index fbab00cdf..25b06611e 100644 --- a/editors/demo/src/HHMI/layout/EditorElements.js +++ b/editors/demo/src/HHMI/layout/EditorElements.js @@ -1,5 +1,16 @@ import { css } from 'styled-components'; +import { th } from '@pubsweet/ui-toolkit'; /* All styles regarding ProseMirror surface and elements */ -export default css``; +const fontWriting = css` + color: ${th('colorText')}; + font-family: ${th('fontWriting')}; + font-size: ${th('fontSizeBase')}; +`; + +export default css` + .ProseMirror { + ${fontWriting} + } +`; diff --git a/editors/demo/src/NCBI/layout/EditorElements.js b/editors/demo/src/NCBI/layout/EditorElements.js index fcb7a36cf..636e7524e 100644 --- a/editors/demo/src/NCBI/layout/EditorElements.js +++ b/editors/demo/src/NCBI/layout/EditorElements.js @@ -14,8 +14,9 @@ export default css` .ProseMirror { background: white; line-height: 12px; - width: 497px; + width: 492px; white-space: pre !important; overflow-x: auto; + ${fontWriting} } `; diff --git a/editors/demo/src/NCBI/layout/EditorMiniElements.js b/editors/demo/src/NCBI/layout/EditorMiniElements.js index acb543571..250d1f51a 100644 --- a/editors/demo/src/NCBI/layout/EditorMiniElements.js +++ b/editors/demo/src/NCBI/layout/EditorMiniElements.js @@ -17,64 +17,10 @@ export default css` line-height: 12px; width: 497px; ${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; - } - - &:focus { - outline: none; - } - } - - .ProseMirror .wax-selection-marker { - background-color: ${th('colorSelection')}; - } - - div[contenteditable='false'] { - pointer-events: none; - user-select: none; } .ProseMirror title { display: inline; font-size: 14px; } - - ul, - ol { - padding-left: 30px; - } - - sup, - sub { - line-height: 0; - } - - p { - line-height: 21px; - } - - /* placeholder */ - .empty-node::before { - color: #aaa; - float: left; - font-style: italic; - pointer-events: none; - height: 0; - } - - p.empty-node:first-child::before { - content: attr(data-content); - } `; diff --git a/wax-prosemirror-core/src/styles/styles.css b/wax-prosemirror-core/src/styles/styles.css index 678342449..670f3b37c 100644 --- a/wax-prosemirror-core/src/styles/styles.css +++ b/wax-prosemirror-core/src/styles/styles.css @@ -3,7 +3,7 @@ background: #fff; color: #111; font-feature-settings: 'liga' 0; /* the above doesn't seem to work in Edge */ - font-family: 'Merriweather'; + font-family: 'Arial'; font-variant-ligatures: none; line-height: 1.6; font-size: 14px; diff --git a/wax-prosemirror-services/src/NoteService/Editor.js b/wax-prosemirror-services/src/NoteService/Editor.js index 4a72ecae8..67310911c 100644 --- a/wax-prosemirror-services/src/NoteService/Editor.js +++ b/wax-prosemirror-services/src/NoteService/Editor.js @@ -27,7 +27,7 @@ export default ({ node, view }) => { let noteView; let clickInNote = false; let typing = false; - // eslint-disable-next-line react/destructuring-assignment + const isEditable = context.view.main.props.editable(editable => { return editable; }); -- GitLab