Skip to content

Commit 9db72c1

Browse files
authored
Fix issue with responsive (#2090)
1 parent 7ace629 commit 9db72c1

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

website/src/repl/Editor.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,5 @@ export function Editor({ value, onChange }: Props): JSX.Element {
4646
};
4747
}, []);
4848

49-
return (
50-
<div
51-
style={{ border: '1px solid var(--code-block-bg-color)' }}
52-
ref={editor}
53-
></div>
54-
);
49+
return <div className="repl-editor" ref={editor}></div>;
5550
}

website/src/repl/Repl.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ function Repl({ defaultValue }: Props): JSX.Element {
140140
<h4>Live example</h4>
141141

142142
<div className="repl-editor-container">
143-
<div style={{ flex: 1 }}>
144-
<Editor value={code} onChange={setCode} />
145-
</div>
143+
<Editor value={code} onChange={setCode} />
146144

147145
<button type="button" onClick={runCode}>
148146
Run

website/src/repl/repl.css

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
gap: 8px;
55
}
66

7+
.repl-editor {
8+
flex: 1;
9+
width: 0; /* See https://stackoverflow.com/a/75423682/2111353, but does only work on "row" mode */
10+
11+
border: 1px solid var(--code-block-bg-color);
12+
}
13+
714
textarea {
815
width: 100%;
916
height: 100px;

website/styles/globals.css

+10
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ a.try-it {
195195
position: relative;
196196
}
197197

198+
@media only screen and (max-width: 1024px) {
199+
.pageBody {
200+
padding: 0;
201+
}
202+
}
203+
198204
.contents {
199205
margin: 0 auto;
200206
max-width: 1024px;
@@ -204,6 +210,10 @@ a.try-it {
204210
flex-direction: row-reverse;
205211
}
206212

213+
.contents > .docContents {
214+
flex-grow: 1;
215+
}
216+
207217
img {
208218
max-width: 1024px;
209219
}

0 commit comments

Comments
 (0)