Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 774863b

Browse files
Rework content width handling
1 parent b1299b1 commit 774863b

File tree

3 files changed

+30
-53
lines changed

3 files changed

+30
-53
lines changed

runestone/activecode/css/activecode.css

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,20 @@
4949
border: 0;
5050
}
5151

52-
.ac_section {
52+
#main-content section .runestone.ac_section .ac_section {
5353
position: relative;
5454
margin-right: auto;
5555
margin-left: auto;
5656
max-width: 800px;
5757
clear: both;
5858
}
5959

60-
.ac_section > *:not(.ac_section) {
61-
max-width: 500pt;
62-
margin-left: auto;
63-
margin-right: auto;
64-
position: relative;
65-
}
66-
6760
.ac_section .clearfix {
6861
position: initial;
6962
}
7063

7164
.ac_output {
7265
display: none;
73-
max-width: 450px;
7466
background-color: inherit;
7567
}
7668
.ac_output pre {

runestone/common/css/runestone-custom-sphinx-bootstrap.css

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
--codeButtonsBorder: #474949;
1919
--dangerAlerts: #f2dede;
2020
--successAlerts: #dff0d8;
21+
--contentWidthRegular: 660px;
22+
--contentWidthWide: 1060px;
2123
}
2224

2325
[data-theme="dark"] {
@@ -221,44 +223,36 @@ div.container {
221223
padding-right: 10px;
222224
}
223225

224-
#main-content section > p,
225-
#main-content section > pre,
226-
#main-content section > table,
227-
#main-content section > ul,
228-
#main-content section > ol,
229-
#main-content section > dl,
230-
#main-content section > h1,
231-
#main-content section > h2,
232-
#main-content section > h3,
233-
#main-content section > h4,
234-
#main-content section > .admonition,
235-
#main-content section > .toctree-wrapper {
236-
width: 500pt;
237-
margin-left: auto;
238-
margin-right: auto;
226+
.runestone {
227+
clear: both;
239228
}
240229

241-
.runestone {
242-
position: relative;
243-
width: 700pt;
230+
/* Sets width of content "column" */
231+
#main-content section > *:not(section) {
232+
max-width: var(--contentWidthRegular);
244233
margin-left: auto;
245234
margin-right: auto;
246-
clear: both;
247235
}
248236

249-
div.highlight pre {
250-
width: 500pt;
251-
margin-left: auto !important;
252-
margin-right: auto !important;
253-
}
254-
/* This rule is meant to override the behavior of the
255-
previous rule since it is not possible to exclude
256-
more than one section in the not() part of the rule
257-
*/
258-
.container section div.full-width {
237+
/* Handle content in nested sections by allowing them to grow*/
238+
#main-content section > section,
239+
/* And then make sure a few items are wider by default */
240+
#main-content section > .runestone.ac_section,
241+
#main-content section > .runestone.codelens,
242+
#main-content section > .question,
243+
#main-content section > .runestone.parsons-container,
244+
#main-content section > .runestone.parsons-problems,
245+
#main-content section > .codelens,
246+
#main-content section > .timedAssessment
247+
{
248+
max-width: var(--contentWidthWide);
259249
margin-left: auto;
260250
margin-right: auto;
261-
width: 90vw;
251+
}
252+
253+
/* Allow individual elements to request being larger */
254+
#main-content section > .full-width {
255+
max-width: var(--contentWidthWide);
262256
}
263257

264258
.container section > img {
@@ -267,12 +261,6 @@ div.highlight pre {
267261
margin-right: auto;
268262
}
269263

270-
.container section .parsons,
271-
.container section .parsons .sortable-code-container,
272-
.container section .cd_section {
273-
max-width: none;
274-
}
275-
276264
.container-fluid > .navbar-collapse,
277265
.container-fluid > .navbar-header,
278266
.container > .navbar-collapse,
@@ -762,7 +750,7 @@ div.flash {
762750
}
763751

764752
.video_popup video {
765-
width: 500pt;
753+
width: var(--contentWidthRegular);
766754
cursor: pointer;
767755
}
768756

runestone/parsons/css/parsons.css

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
.parsons-container {
2-
position: relative;
3-
width: 800pt;
4-
margin-left: auto;
5-
margin-right: auto;
62
clear: both;
73
}
84

@@ -280,7 +276,7 @@
280276
margin: 10px 0;
281277
}
282278
.parsons .parsons-text {
283-
max-width: 500pt;
279+
max-width: var(--contentWidthRegular);
284280
margin-left: auto;
285281
margin-right: auto;
286282
}
@@ -292,13 +288,14 @@
292288
}
293289

294290
.parsons .parsons-controls {
295-
max-width: 500pt;
291+
max-width: var(--contentWidthRegular);
296292
margin-left: auto;
297293
margin-right: auto;
298294
text-align: center;
299295
}
296+
300297
.parsons [role="tooltip"] {
301-
max-width: 500pt;
298+
max-width: var(--contentWidthRegular);
302299
margin-left: auto;
303300
margin-right: auto;
304301
margin-top: 5px;

0 commit comments

Comments
 (0)