Skip to content

Commit 0ee9707

Browse files
committed
Width of #content varies, so #left-pane children also vary
1 parent d906734 commit 0ee9707

File tree

1 file changed

+39
-17
lines changed

1 file changed

+39
-17
lines changed

datafiles/static/hackage.css

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,30 @@ table.properties td, table.properties th {
315315
/* keep this in sync with #left-pane children */
316316
width: 60vw;
317317
}
318+
319+
#left-pane > * {
320+
/* (100% - (width of properties)) * (width of #content) - gap
321+
* = (100% - 40% ) * 60vw - 2em
322+
* = 60% * 60vw - 2em
323+
* = 36vw - 2em
324+
*/
325+
width: calc(36vw - 2em);
326+
}
318327
}
319328

320329
@media only screen and (min-width: 1280px) and (max-width: 1919px) {
321330
#content {
322331
width: 65vw;
323332
}
333+
334+
#left-pane > * {
335+
/* (100% - (width of properties)) * (width of #content) - gap
336+
* = (100% - 40% ) * 65vw - 2em
337+
* = 60% * 65vw - 2em
338+
* = 39vw - 2em
339+
*/
340+
width: calc(39vw - 2em);
341+
}
324342
}
325343

326344
@media only screen and (min-width: 1280px) {
@@ -345,6 +363,15 @@ table.properties td, table.properties th {
345363
#content {
346364
width: 75vw;
347365
}
366+
367+
#left-pane > * {
368+
/* (100% - (width of properties)) * (width of #content) - gap
369+
* = (100% - 40% ) * 75vw - 2em
370+
* = 60% * 75vw - 2em
371+
* = 45vw - 2em
372+
*/
373+
width: calc(45vw - 2em);
374+
}
348375
}
349376

350377
@media only screen and (min-width: 950px) {
@@ -376,23 +403,6 @@ table.properties td, table.properties th {
376403
margin-bottom: 2em;
377404
}
378405

379-
#left-pane > * {
380-
/* (100% - (width of properties)) * (width of #content) - gap
381-
* = (100% - 40% ) * 60vw - 2em
382-
* = 60% * 60vw - 2em
383-
* = 36vw - 2em
384-
*/
385-
width: calc(36vw - 2em);
386-
}
387-
388-
#left-pane > #modules {
389-
/* This overrides the width in the previous block. We want a long module
390-
* name to make the left-pane wide, so that it will push down
391-
* #properties.
392-
*/
393-
width: fit-content;
394-
}
395-
396406
#flex-container {
397407
display: flex;
398408
flex-wrap: wrap;
@@ -406,6 +416,10 @@ table.properties td, table.properties th {
406416
width: 88vw;
407417
}
408418

419+
#left-pane > * {
420+
width: fit-content;
421+
}
422+
409423
#page-header {
410424
text-align: center;
411425
padding: 6px 0 4px 0;
@@ -461,6 +475,14 @@ table.properties td, table.properties th {
461475

462476
/* @group Page Structure */
463477

478+
#left-pane > #modules {
479+
/* This overrides the width in width-dependent blocks. We want a long
480+
* module name to make the left-pane wide, so that it will push down
481+
* #properties.
482+
*/
483+
width: fit-content;
484+
}
485+
464486
#content {
465487
margin: 0 auto;
466488
padding: 0;

0 commit comments

Comments
 (0)