New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display: grid for editor toolbar, editor and preview #7787
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Should there also be a fullscreen button for the editor? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's much better now.
Hi @Jermolene @pmario - I think this is ready for review |
I think, we also needs some documentation, that tells users about the new CSS It should make it easier for plugin authors to deal with the new grid areas |
@Jermolene -- It looks good to me now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BurningTreeC @pmario
@@ -18,7 +18,7 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$ | |||
importState=<<qualify $:/state/ImportImage>> > | |||
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> > | |||
<div> | |||
<div class={{{ [function[edit-preview-state]match[yes]then[tc-tiddler-preview]] +[join[ ]] }}}> | |||
<div class={{{ [function[edit-preview-state]match[yes]then[tc-tiddler-preview]else[tc-no-tiddler-preview]] [[tc-grid]] +[join[ ]] }}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to use semantic class names, and avoid functional names such as "tc-grid". I think it would be clearer to replace tc-no-tiddler-preview
with tc-tiddler-preview-hidden
, and to use tc-tiddler-preview-frame
instead of tc-grid
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think tc-tiddler-preview-frame
is way to specific. tc-grid
only contains 1 setting to use grid. It can be reused that way.
tc-tiddler-preview-frame
is completely misleading since it is not set to the preview-frame, but it's parent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I want to define tc-grid
to any other gird with a completely different context in the sidebar or control-panel tc-tiddler-preview-frame
would be misleading. IMO it should be as generic as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmario if we use tc-grid
and reuse it elsewhere then we'll be constrained that we can't change the styling of just the preview pane. As I said before, functional class names are an anti-pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use tc-tiddler-editor
instead of tc-grid
.
That's not true. Have a closer look at the CSS code.
IMO We could use |
Hi @pmario our CSS classes are designed not just to accomplish a particular visual layout but to provide a surface area for customisations. If we use a single |
@BurningTreeC ... I did have a closer look again.
Let's go with We will have the Can you check the following again? For me |
I went with Should be good now 👍 |
Terrific, thank you @BurningTreeC |
This seems to conflict with the flexbox layout of cm6 (maybe), but cm5 does not have this situation. @Jermolene @BurningTreeC Screenity.video.-.Jan.9.2024.mp4 |
Hi @oeyoews are you saying that the new CSS grid layout of the editor pane interferes with CodeMirror 6? It's hard to see how that could happen if CM6 adapts correctly to the size of its container. |
The reason is really not easy to investigate, and I don’t have any clue. What is certain is that if the width of the element is specified, it will cause this problem, unless width: 100% is specified. @Jermolene Screenity.video.-.Jan.9.2024.1.mp4 |
Thanks @oeyoews could it be fixed by introducing a wrapper element with |
No, it doesn't work |
After looking at the usage of grid-template, this should fix the problem, .tc-tiddler-preview {
grid-template-columns: repeat(2, minmax(0px, 1fr)) !important;
} |
no |
This PR makes the div surrounding the toolbar, editor and preview
display: grid
It also adds the necessary styles so that editor and preview are displayed full width, not 49% as before
It also takes into account that the bitmap editor has variable width and height
see Idea #7771