From 99dc0deb080ac8384d2c93ace7232af471a71e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:00:57 +0200 Subject: [PATCH 01/12] foldgutter styles --- shared/naturalcrit/codeEditor/codeEditor.less | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index cb73b0a88..1d321a7e5 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -26,6 +26,15 @@ color: grey; } + .CodeMirror-foldgutter { + transition:background 0.1s; + border-left:1px solid #eee; + cursor:pointer; + &:hover { + background:#ddd; + } + } + .sourceMoveFlash .CodeMirror-line{ animation-name: sourceMoveAnimation; animation-duration: 0.4s; From 3a2c213cf83ff8431bdc7dfb5f83ad73a64dc510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:02:00 +0200 Subject: [PATCH 02/12] linting codeeditor.les --- shared/naturalcrit/codeEditor/codeEditor.less | 82 +++++++++---------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/shared/naturalcrit/codeEditor/codeEditor.less index 1d321a7e5..84a5c63f1 100644 --- a/shared/naturalcrit/codeEditor/codeEditor.less +++ b/shared/naturalcrit/codeEditor/codeEditor.less @@ -11,58 +11,54 @@ @import (less) './themes/fonts/iconFonts/fontAwesome.less'; @keyframes sourceMoveAnimation { - 50% {background-color: red; color: white;} - 100% {background-color: unset; color: unset;} + 50% { color : white;background-color : red;} + 100% { color : unset;background-color : unset;} } -.codeEditor{ - @media screen and (pointer : coarse) { - font-size : 16px; - } - .CodeMirror-foldmarker { - font-family: inherit; - text-shadow: none; - font-weight: 600; - color: grey; - } +.codeEditor { + @media screen and (pointer : coarse) { + font-size : 16px; + } + .CodeMirror-foldmarker { + font-family : inherit; + font-weight : 600; + color : grey; + text-shadow : none; + } - .CodeMirror-foldgutter { - transition:background 0.1s; - border-left:1px solid #eee; - cursor:pointer; - &:hover { - background:#ddd; - } - } + .CodeMirror-foldgutter { + cursor : pointer; + border-left : 1px solid #EEEEEE; + transition : background 0.1s; + &:hover { background : #DDDDDD; } + } - .sourceMoveFlash .CodeMirror-line{ - animation-name: sourceMoveAnimation; - animation-duration: 0.4s; - } + .sourceMoveFlash .CodeMirror-line { + animation-name : sourceMoveAnimation; + animation-duration : 0.4s; + } - .CodeMirror-vscrollbar { - &::-webkit-scrollbar { - width: 20px; - } - &::-webkit-scrollbar-thumb { - width: 20px; - background: linear-gradient(90deg, #858585 15px, #808080 15px); - } - } + .CodeMirror-vscrollbar { + &::-webkit-scrollbar { width : 20px; } + &::-webkit-scrollbar-thumb { + width : 20px; + background : linear-gradient(90deg, #858585 15px, #808080 15px); + } + } - //.cm-tab { - // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right; - //} + //.cm-tab { + // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right; + //} - //.cm-trailingspace { - // .cm-space { - // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQAgMAAABW5NbuAAAACVBMVEVHcEwAAAAAAAAWawmTAAAAA3RSTlMAPBJ6PMxpAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAFUlEQVQI12NgwACcCQysASAEZGAAACMuAX06aCQUAAAAAElFTkSuQmCC) no-repeat right; - // } - //} + //.cm-trailingspace { + // .cm-space { + // background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQAgMAAABW5NbuAAAACVBMVEVHcEwAAAAAAAAWawmTAAAAA3RSTlMAPBJ6PMxpAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAFUlEQVQI12NgwACcCQysASAEZGAAACMuAX06aCQUAAAAAElFTkSuQmCC) no-repeat right; + // } + //} } .emojiPreview { - font-size: 1.5em; - line-height: 1.2em; + font-size : 1.5em; + line-height : 1.2em; } \ No newline at end of file From c1d85bc216fe4d29821ef10d7042eecbf131aaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:12:39 +0200 Subject: [PATCH 03/12] remove annoying class --- client/homebrew/editor/snippetbar/snippetbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d457d92f2..877be6847 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -235,7 +235,7 @@ const Snippetbar = createClass({
{foldButtons} -
{this.state.themeSelector && this.renderThemeSelector()} From 08eabf8102970686052cc6f9b48e2a6397eecdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:12:52 +0200 Subject: [PATCH 04/12] proper snippetbar styles --- .../homebrew/editor/snippetbar/snippetbar.less | 17 ++++++++++++++++- shared/naturalcrit/splitPane/splitPane.less | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index c50d9df4c..65b3336fb 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -20,8 +20,23 @@ height : @menuHeight; line-height : @menuHeight; text-align : center; - cursor : pointer; + + &:not(.editorTool, .divider) { + cursor: pointer; + } + &:hover,&.selected { background-color : #999999; } + + &.editorTool { + background-color: unset; + + &.active { + cursor:pointer; + &:hover { + background-color: #999999; + } + } + } &.text { .tooltipLeft('Brew Editor'); } diff --git a/shared/naturalcrit/splitPane/splitPane.less b/shared/naturalcrit/splitPane/splitPane.less index e5b3dd7f8..f45bbb681 100644 --- a/shared/naturalcrit/splitPane/splitPane.less +++ b/shared/naturalcrit/splitPane/splitPane.less @@ -10,7 +10,7 @@ overflow-y : hidden; flex : 1; } - .divider{ + >.divider{ touch-action : none; display : table; height : 100%; From 2b270ccdb703c3f6fb243feaef3ca8bbe80ef334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:14:12 +0200 Subject: [PATCH 05/12] linting --- .../editor/snippetbar/snippetbar.less | 28 ++++----- shared/naturalcrit/splitPane/splitPane.less | 60 +++++++++---------- 2 files changed, 38 insertions(+), 50 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 65b3336fb..0ec08da98 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -21,20 +21,16 @@ line-height : @menuHeight; text-align : center; - &:not(.editorTool, .divider) { - cursor: pointer; - } + &:not(.editorTool, .divider) { cursor : pointer; } &:hover,&.selected { background-color : #999999; } &.editorTool { - background-color: unset; + background-color : unset; &.active { - cursor:pointer; - &:hover { - background-color: #999999; - } + cursor : pointer; + &:hover { background-color : #999999; } } } &.text { @@ -70,17 +66,13 @@ } &.history { .tooltipLeft('History'); + position : relative; font-size : 0.75em; color : grey; - position : relative; - &.active { - color : inherit; - } - &>.dropdown{ + &.active { color : inherit; } + & > .dropdown { right : -1px; - &>.snippet{ - padding-right : 10px; - } + & > .snippet { padding-right : 10px; } } } &.editorTheme { @@ -157,11 +149,11 @@ cursor : pointer; .animate(background-color); i { + min-width : 25px; height : 1.2em; margin-right : 8px; font-size : 1.2em; - min-width: 25px; - text-align: center; + text-align : center; & ~ i { margin-right : 0; margin-left : 5px; diff --git a/shared/naturalcrit/splitPane/splitPane.less b/shared/naturalcrit/splitPane/splitPane.less index f45bbb681..88e6cb927 100644 --- a/shared/naturalcrit/splitPane/splitPane.less +++ b/shared/naturalcrit/splitPane/splitPane.less @@ -1,69 +1,65 @@ -.splitPane{ +.splitPane { position : relative; display : flex; + flex-direction : row; height : 100%; outline : none; - flex-direction : row; - .pane{ + .pane { + flex : 1; overflow-x : hidden; overflow-y : hidden; - flex : 1; } - >.divider{ - touch-action : none; + >.divider { display : table; - height : 100%; width : 15px; - cursor : ew-resize; - background-color : #bbb; + height : 100%; text-align : center; - .dots{ + touch-action : none; + cursor : ew-resize; + background-color : #BBBBBB; + .dots { display : table-cell; - vertical-align : middle; text-align : center; - i{ + vertical-align : middle; + i { display : block !important; margin : 10px 0px; font-size : 6px; - color : #666; + color : #666666; } } - &:hover{ - background-color: #999; - } + &:hover { background-color : #999999; } } - .arrow{ + .arrow { position : absolute; + z-index : 999; width : 25px; height : 25px; - border : 2px solid #bbb; - border-radius : 15px; - text-align : center; font-size : 1.2em; + text-align : center; cursor : pointer; - background-color : #ddd; - z-index : 999; - box-shadow : 0 4px 5px #0000007f; - &.left{ + background-color : #DDDDDD; + border : 2px solid #BBBBBB; + border-radius : 15px; + box-shadow : 0 4px 5px #0000007F; + &.left { .tooltipLeft('Jump to location in Editor'); top : 30px; } - &.right{ + &.right { .tooltipRight('Jump to location in Preview'); top : 60px; } - &.lock{ + &.lock { .tooltipRight('De-sync Editor and Preview locations.'); - top : 90px; - background: #666; + top : 90px; + background : #666666; } - &.unlock{ + &.unlock { .tooltipRight('Sync Editor and Preview locations'); top : 90px; } - &:hover{ - background-color: #666; - } + &:hover { background-color : #666666; } } } From 2118142faadede866c8711a3e980ab87c98d7afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:16:36 +0200 Subject: [PATCH 06/12] not allowed cursor --- client/homebrew/editor/snippetbar/snippetbar.less | 1 + 1 file changed, 1 insertion(+) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 0ec08da98..06e95f345 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -27,6 +27,7 @@ &.editorTool { background-color : unset; + cursor:not-allowed; &.active { cursor : pointer; From 3e6884b506c3ccab41ee82be271804863bfdf755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:32:28 +0200 Subject: [PATCH 07/12] dynamic input width --- client/homebrew/brewRenderer/toolBar/toolBar.jsx | 1 + client/homebrew/brewRenderer/toolBar/toolBar.less | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.jsx b/client/homebrew/brewRenderer/toolBar/toolBar.jsx index 73b48d778..fd4299f1f 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.jsx +++ b/client/homebrew/brewRenderer/toolBar/toolBar.jsx @@ -139,6 +139,7 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{ name='page' inputMode='numeric' pattern='[0-9]' + style={{width:`${pageNum.toString().length + 2}ch`}} value={pageNum} onClick={(e)=>e.target.select()} onChange={(e)=>handlePageInput(e.target.value)} diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.less b/client/homebrew/brewRenderer/toolBar/toolBar.less index 3bed0eeda..b870aa7c4 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.less +++ b/client/homebrew/brewRenderer/toolBar/toolBar.less @@ -50,10 +50,10 @@ color : #D3D3D3; accent-color : #D3D3D3; - &::-webkit-slider-thumb, &::-moz-slider-thumb { + &::-webkit-slider-thumb, &::-moz-range-thumb { width : 5px; height : 5px; - cursor : pointer; + cursor : ew-resize; outline : none; } @@ -76,7 +76,7 @@ // `.text-input` if generic to all range inputs, or `#page-input` if only for current page input &#page-input { - width : 4ch; + max-width : 7ch; margin-right : 1ch; text-align : center; } From 766fd40b72b3c537fa06b550d718ca556b792366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 11 Oct 2024 00:35:43 +0200 Subject: [PATCH 08/12] set cursor in code less for disabled elements --- shared/naturalcrit/styles/core.less | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/naturalcrit/styles/core.less b/shared/naturalcrit/styles/core.less index c742ad7b1..271c151c1 100644 --- a/shared/naturalcrit/styles/core.less +++ b/shared/naturalcrit/styles/core.less @@ -46,5 +46,6 @@ button{ } &:disabled{ background-color : @silver !important; + cursor:not-allowed; } } From 213240327df34ecab5e865d2866438e0de641688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 9 Dec 2024 22:05:04 +0100 Subject: [PATCH 09/12] resolve issues --- client/homebrew/editor/snippetbar/snippetbar.less | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 319cd0cad..4eed778a8 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -31,13 +31,18 @@ &:first-child { border-left : none; } - & > div { + & > .editorTool { position : relative; width : @menuHeight; height : @menuHeight; line-height : @menuHeight; text-align : center; cursor : pointer; + + &:not(.active) { + cursor:not-allowed; + } + &:hover,&.selected { background-color : #999999; } &.text { .tooltipLeft('Brew Editor'); From 2c5c3d40df396b8172f32a1bef388b9560c71765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 9 Dec 2024 22:08:39 +0100 Subject: [PATCH 10/12] revert toolbar changes --- client/homebrew/brewRenderer/toolBar/toolBar.jsx | 1 - client/homebrew/brewRenderer/toolBar/toolBar.less | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.jsx b/client/homebrew/brewRenderer/toolBar/toolBar.jsx index 7a307ec66..b0300e0e4 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.jsx +++ b/client/homebrew/brewRenderer/toolBar/toolBar.jsx @@ -200,7 +200,6 @@ const ToolBar = ({ displayOptions, currentPage, totalPages, onDisplayOptionsChan title='Current page(s) in view' inputMode='numeric' pattern='[0-9]' - style={{width:`${pageNum.toString().length + 2}ch`}} value={pageNum} onClick={(e)=>e.target.select()} onChange={(e)=>handlePageInput(e.target.value)} diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.less b/client/homebrew/brewRenderer/toolBar/toolBar.less index 8fc5b0519..c787a6f6b 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.less +++ b/client/homebrew/brewRenderer/toolBar/toolBar.less @@ -141,7 +141,7 @@ // `.text-input` if generic to all range inputs, or `#page-input` if only for current page input &#page-input { - max-width : 7ch; + width : 4ch; margin-right : 1ch; text-align : center; } From 3e4ba89ed9554ed9fde4f442446cdf138db85db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 9 Dec 2024 22:11:10 +0100 Subject: [PATCH 11/12] change div selector --- client/homebrew/editor/snippetbar/snippetbar.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 4eed778a8..86b68f2cb 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -31,7 +31,7 @@ &:first-child { border-left : none; } - & > .editorTool { + & > div { position : relative; width : @menuHeight; height : @menuHeight; @@ -39,7 +39,7 @@ text-align : center; cursor : pointer; - &:not(.active) { + &.editorTool:not(.active) { cursor:not-allowed; } From 3a20452214b22bbc102f297cbbd57c70f543b398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 9 Dec 2024 22:18:15 +0100 Subject: [PATCH 12/12] hide unusable editors --- .../homebrew/editor/snippetbar/snippetbar.jsx | 32 +++++++++---------- .../editor/snippetbar/snippetbar.less | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 325d95efc..f7d9508f8 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -207,19 +207,11 @@ const Snippetbar = createClass({ renderEditorButtons : function(){ if(!this.props.showEditButtons) return; - const foldButtons = <> -
- -
-
- -
- ; + - return
-
+ return ( +
+ {this.props.view !== 'meta' && <>
@@ -235,14 +227,21 @@ const Snippetbar = createClass({
- {foldButtons} +
+ +
+
+ +
{this.state.themeSelector && this.renderThemeSelector()}
-
- +
} +
-
; +
+ ) }, render : function(){ diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 86b68f2cb..7d56dc718 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -22,7 +22,7 @@ justify-content : flex-end; min-width : 225px; - &:only-child { margin-left : auto; } + &:only-child { margin-left : auto;min-width:unset;} >div { display : flex;