Skip to content

Commit 8ffa436

Browse files
committed
Editors: Adjusted new design for mobile and dark mode
Tested new design across FF, Chrome, and Gnome web (webkit)
1 parent 8c10959 commit 8ffa436

File tree

3 files changed

+56
-17
lines changed

3 files changed

+56
-17
lines changed

resources/js/components/editor-toolbox.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class EditorToolbox extends Component {
88
this.buttons = this.$manyRefs.tabButton;
99
this.contentElements = this.$manyRefs.tabContent;
1010
this.toggleButton = this.$refs.toggle;
11+
this.editorWrapEl = this.container.closest('.page-editor');
1112

1213
this.setupListeners();
1314

@@ -30,8 +31,9 @@ export class EditorToolbox extends Component {
3031

3132
toggle() {
3233
this.container.classList.toggle('open');
33-
const expanded = this.container.classList.contains('open') ? 'true' : 'false';
34-
this.toggleButton.setAttribute('aria-expanded', expanded);
34+
const isOpen = this.container.classList.contains('open');
35+
this.toggleButton.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
36+
this.editorWrapEl.classList.toggle('toolbox-open', isOpen);
3537
}
3638

3739
setActiveTab(tabName, openToolbox = false) {

resources/sass/_pages.scss

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
width: 100%;
2424
border-radius: 8px;
2525
box-shadow: $bs-card;
26-
background-color: #FFF;
26+
@include lightDark(background-color, #FFF, #333)
2727
}
2828

2929
.page-edit-toolbar {
@@ -34,13 +34,23 @@
3434
align-items: center;
3535
}
3636

37-
.page-editor-wysiwyg .page-edit-toolbar,
38-
.page-editor-wysiwyg .page-editor-page-area {
39-
max-width: 1140px;
37+
@include larger-than($xxl) {
38+
.page-editor-wysiwyg .page-edit-toolbar,
39+
.page-editor-wysiwyg .page-editor-page-area {
40+
max-width: 1140px;
41+
}
42+
43+
.page-editor-wysiwyg .floating-toolbox {
44+
position: absolute;
45+
}
4046
}
4147

42-
.page-editor-markdown .floating-toolbox {
43-
position: relative;
48+
@include smaller-than($m) {
49+
.page-edit-toolbar {
50+
display: flex;
51+
flex-direction: row;
52+
justify-content: space-between;
53+
}
4454
}
4555

4656
.title-input.page-title {
@@ -88,8 +98,7 @@ body.tox-fullscreen, body.markdown-fullscreen {
8898
overflow-x: scroll;
8999
overflow-y: visible;
90100
}
91-
.page-edit-toolbar .grid.third {
92-
display: block;
101+
.page-edit-toolbar {
93102
white-space: nowrap;
94103
> div {
95104
display: inline-block;
@@ -101,10 +110,10 @@ body.tox-fullscreen, body.markdown-fullscreen {
101110
position: fixed;
102111
z-index: 30;
103112
border-radius: 50%;
104-
width: 56px;
105-
height: 56px;
106-
font-size: 24px;
107-
right: $-m;
113+
width: 52px;
114+
height: 52px;
115+
font-size: 26px;
116+
right: $-xs;
108117
bottom: $-s;
109118
box-shadow: $bs-hover;
110119
background-color: currentColor;
@@ -202,7 +211,7 @@ body.tox-fullscreen, body.markdown-fullscreen {
202211
}
203212
}
204213

205-
// Attribute form
214+
// Page editor sidebar toolbox
206215
.floating-toolbox {
207216
@include lightDark(background-color, #FFF, #222);
208217
overflow: hidden;
@@ -214,7 +223,7 @@ body.tox-fullscreen, body.markdown-fullscreen {
214223
box-shadow: $bs-card;
215224
margin-bottom: auto;
216225
margin-left: $-l;
217-
position: absolute;
226+
position: relative;
218227
&.open {
219228
position: relative;
220229
right: 0;
@@ -242,6 +251,7 @@ body.tox-fullscreen, body.markdown-fullscreen {
242251
}
243252
.tabs {
244253
border-right: 1px solid #DDD;
254+
@include lightDark(border-right-color, #DDD, #000);
245255
width: 40px;
246256
flex: 0 1 auto;
247257
margin-right: -1px;
@@ -300,6 +310,33 @@ body.tox-fullscreen, body.markdown-fullscreen {
300310
}
301311
}
302312

313+
@include smaller-than($xxl) {
314+
.floating-toolbox {
315+
margin-left: $-s;
316+
}
317+
}
318+
319+
@include smaller-than($s) {
320+
.page-editor-page-area-wrap {
321+
margin: 4px !important;
322+
}
323+
.floating-toolbox {
324+
margin-left: 4px;
325+
}
326+
.floating-toolbox .tabs {
327+
width: 32px;
328+
}
329+
.floating-toolbox .tabs-inner > button {
330+
font-size: 12px;
331+
}
332+
.page-edit-toolbar {
333+
padding-block: 0 !important;
334+
}
335+
.page-editor.toolbox-open .page-editor-page-area {
336+
display: none;
337+
}
338+
}
339+
303340
.toolbox-tab-content {
304341
display: none;
305342
overflow-y: auto;

resources/views/pages/parts/form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{{--Header Toolbar--}}
2121
@include('pages.parts.editor-toolbar', ['model' => $model, 'editor' => $editor, 'isDraft' => $isDraft, 'draftsEnabled' => $draftsEnabled])
2222

23-
<div class="flex flex-fill mx-s mb-s justify-center">
23+
<div class="flex flex-fill mx-s mb-s justify-center page-editor-page-area-wrap">
2424
<div class="page-editor-page-area flex-container-column flex flex-fill">
2525
{{--Title input--}}
2626
<div class="title-input page-title clearfix">

0 commit comments

Comments
 (0)