Skip to content

Commit 47a6085

Browse files
committed
Added responsive playground
1 parent 769849b commit 47a6085

File tree

4 files changed

+58
-129
lines changed

4 files changed

+58
-129
lines changed

docs/client/components/PlaygroundPage/PlaygroundWithPreview/editor.css

Lines changed: 0 additions & 115 deletions
This file was deleted.

docs/client/components/PlaygroundPage/PlaygroundWithPreview/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class PlaygroundWithPreview extends React.Component {
3030
<div className="header">
3131
Playground
3232
</div>
33+
<div className="warning">
34+
(Editor not available at this screen size)
35+
</div>
3336
<LiveProvider
3437
scope={{ ...components, theme }}
3538
code={this.props.defaultCode}

docs/client/components/PlaygroundPage/PlaygroundWithPreview/styles.scss

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,64 @@
22
.prism-code {
33
white-space: pre-wrap !important;
44
}
5-
.code-editor {
6-
width: 50%;
7-
float: left;
5+
.header {
6+
font-size: 1.5rem;
7+
font-weight: bold;
88
}
9-
10-
.code-preview {
11-
width: 45%;
12-
float: left;
13-
margin-left: 15px;
14-
.error {
15-
color: red;
9+
@media (min-width: 800px) {
10+
.header {
11+
margin-left: 5px;
12+
}
13+
.warning {
14+
display: none;
15+
}
16+
.code-editor {
17+
width: 50%;
18+
float: left;
19+
}
20+
21+
.code-preview {
22+
width: 45%;
23+
float: left;
24+
margin-left: 15px;
25+
.error {
26+
color: red;
27+
}
28+
}
29+
30+
.doc-enabler {
31+
text-align: center;
32+
margin-top: 40px;
1633
}
1734
}
35+
36+
@media (max-width: 800px) {
37+
.header {
38+
margin: 10px auto;
39+
width: 80%;
40+
}
41+
.warning {
42+
margin: 10px auto;
43+
width: 80%;
44+
font-size: 1.2rem;
45+
color: red;
46+
}
47+
.code-editor {
48+
display: none;
49+
}
1850

19-
.doc-enabler {
20-
text-align: center;
21-
margin-top: 40px;
51+
.code-preview {
52+
width: 90%;
53+
margin: 15px;
54+
margin-right: 15px;
55+
.error {
56+
color: red;
57+
}
58+
}
59+
60+
.doc-enabler {
61+
display: none;
62+
}
2263
}
64+
2365
}

src/card/theme.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
background: #FFFFFF;
33
border-radius: 3px;
44
padding: 10px;
5-
min-width: 300px;
65
margin: 5px;
76
}
87

0 commit comments

Comments
 (0)