Skip to content

Commit

Permalink
Merge pull request #5609 from ckeditor/i/5598
Browse files Browse the repository at this point in the history
Docs: Improved RWD of the demos in the "Examples" section. Closes #5598.
  • Loading branch information
oleq authored Oct 17, 2019
2 parents 7bff23b + 243752c commit 6a869ff
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 25 deletions.
36 changes: 36 additions & 0 deletions docs/_snippets/examples/document-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,40 @@ <h3 style="text-align:center;">Welcome letter</h3>
.document-editor .ck-content table td {
vertical-align: middle;
}

@media only screen and (max-width: 960px) {
/* Because on mobile 2cm paddings are to big. */
.document-editor__editable-container .document-editor__editable.ck-editor__editable {
padding: 1.5em;
}
}

@media only screen and (max-width: 1200px) {
.main__content-wide .document-editor__editable-container .document-editor__editable.ck-editor__editable {
width: 100%;
}
}

/* Style document editor a'ka Google Docs.*/
@media only screen and (min-width: 1360px) {
.main .main__content.main__content-wide {
padding-right: 0;
}
}

@media only screen and (min-width: 1600px) {
.main .main__content.main__content-wide {
width: 24cm;
}

.main .main__content.main__content-wide .main__content-inner {
width: auto;
margin: 0 50px;
}

/* Keep "page" look based on viewport width. */
.main__content-wide .document-editor__editable-container .document-editor__editable.ck-editor__editable {
width: 60%;
}
}
</style>
39 changes: 15 additions & 24 deletions docs/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
*/

/* https://github.com/ckeditor/ckeditor5/issues/913 */
@media only screen and (min-width: 1600px) {
/* https://github.com/ckeditor/ckeditor5/issues/1077 */
.main .main__content .main__content-inner,
.main .main__content-wide .main__content-inner {
width: 840px;
/* https://github.com/ckeditor/ckeditor5/issues/5598. */
@media only screen and (min-width: 960px) and (max-width: 1024px ) {
.main .main__content {
/* Reduce content width including side navigation (340px). */
max-width: calc( 100% - 340px );
min-width: auto;
}
}

Expand All @@ -17,31 +17,22 @@ https://github.com/ckeditor/ckeditor5-build-decoupled-document/issues/12 */
/* https://github.com/ckeditor/ckeditor5/issues/1077 */
.main .main__content .main__content-inner,
.main .main__content-wide .main__content-inner {
max-width: 900px;
padding-left: 30px;
padding-right: 30px
}
}

/* https://github.com/ckeditor/ckeditor5/issues/913 */
@media only screen and (min-width: 1360px) {
.main .main__content.main__content-wide {
padding-right: 0;
}

.main .main__content-wide .main__content-inner {
max-width: 840px;
/* https://github.com/ckeditor/ckeditor5/issues/5598. */
@media only screen and (max-width: 1360px) {
.main .main__content-inner {
max-width: 960px;
}
}

/* https://github.com/ckeditor/ckeditor5/issues/1007 */
@media only screen and (min-width: 1600px) {
.main .main__content.main__content-wide {
/*
* `.main__content` by default has 760px width and 340px right padding.
* `.main__content-wide` is 40px wider (800px), that's why we are reducing this right padding.
*/
padding-right: 300px;
/* https://github.com/ckeditor/ckeditor5/issues/5598. */
@media only screen and (min-width: 1360px) {
.main .main__content--no-toc .main__content-inner {
/* Because there is `width: auto`, we need to set some minimal value. */
min-width: 910px;
}
}

Expand Down
1 change: 1 addition & 0 deletions docs/examples/builds/balloon-block-editor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
category: examples-builds
order: 30
classes: main__content--no-toc
---

# Balloon block editor
Expand Down
1 change: 1 addition & 0 deletions docs/examples/builds/balloon-editor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
category: examples-builds
order: 30
classes: main__content--no-toc
---

# Balloon editor
Expand Down
1 change: 1 addition & 0 deletions docs/examples/builds/classic-editor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
category: examples-builds
order: 10
classes: main__content--no-toc
---

# Classic editor
Expand Down
1 change: 1 addition & 0 deletions docs/examples/builds/custom-build.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
category: examples-builds
order: 40
classes: main__content--no-toc
---

# Custom build
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/builds/document-editor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
category: examples-builds
order: 30
classes: main__content-wide
classes: 'main__content-wide main__content--no-toc'
---

# Document editor
Expand Down
1 change: 1 addition & 0 deletions docs/examples/builds/inline-editor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
category: examples-builds
order: 20
classes: main__content--no-toc
---

# Inline editor
Expand Down

0 comments on commit 6a869ff

Please sign in to comment.