Skip to content

Commit 428a823

Browse files
authored
Merge pull request #1022 from ysangkok/flex-box-properties
Use flexbox instead of float
2 parents 6c53b70 + 0ee9707 commit 428a823

File tree

3 files changed

+245
-218
lines changed

3 files changed

+245
-218
lines changed

datafiles/static/hackage.css

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,33 @@ table.properties td, table.properties th {
312312

313313
@media only screen and (min-width: 1920px) {
314314
#content {
315+
/* keep this in sync with #left-pane children */
315316
width: 60vw;
316317
}
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+
}
317327
}
318328

319329
@media only screen and (min-width: 1280px) and (max-width: 1919px) {
320330
#content {
321331
width: 65vw;
322332
}
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+
}
323342
}
324343

325344
@media only screen and (min-width: 1280px) {
@@ -344,6 +363,15 @@ table.properties td, table.properties th {
344363
#content {
345364
width: 75vw;
346365
}
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+
}
347375
}
348376

349377
@media only screen and (min-width: 950px) {
@@ -370,19 +398,28 @@ table.properties td, table.properties th {
370398
}
371399

372400
div #properties {
373-
float:right;
374401
background: #fefefe;
375402
width: 40%;
376-
margin-left: 2em;
377403
margin-bottom: 2em;
378404
}
405+
406+
#flex-container {
407+
display: flex;
408+
flex-wrap: wrap;
409+
justify-content: space-between;
410+
gap: 2em; /* keep this in sync with calculation above */
411+
}
379412
}
380413

381414
@media only screen and (max-width: 949px) {
382415
#content {
383416
width: 88vw;
384417
}
385418

419+
#left-pane > * {
420+
width: fit-content;
421+
}
422+
386423
#page-header {
387424
text-align: center;
388425
padding: 6px 0 4px 0;
@@ -438,6 +475,14 @@ table.properties td, table.properties th {
438475

439476
/* @group Page Structure */
440477

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+
441486
#content {
442487
margin: 0 auto;
443488
padding: 0;
@@ -836,16 +881,6 @@ ul.links li form button {
836881
#module-list ul {
837882
list-style: none;
838883
margin: 0 0 0 20px;
839-
840-
/* Warning: Needed for oldIE support, but words are broken up letter-by-letter */
841-
-ms-word-break: break-all;
842-
word-break: break-all;
843-
/* Non standard for webkit */
844-
word-break: break-word;
845-
-webkit-hyphens: auto;
846-
-moz-hyphens: auto;
847-
-ms-hyphens: auto;
848-
hyphens: auto;
849884
}
850885

851886
/* Disable identation for the top level modules */

0 commit comments

Comments
 (0)