| 1 |
/* |
| 2 |
There are three main layout components. |
| 3 |
|
| 4 |
The header (<header>), the left sidebar (<aside>) and the main content (<article>). |
| 5 |
In the HTML markup, they are all direct children of the <body>. |
| 6 |
|
| 7 |
These elements are arranged as follows: |
| 8 |
|
| 9 |
header |
| 10 |
------------ |
| 11 |
aside | main |
| 12 |
|
| 13 |
On mobile at resolutions smaller than 768px, we hide the aside menu, |
| 14 |
having it slide in from the left side. This means that iPads and larger will show the side menu. |
| 15 |
|
| 16 |
For most reports, we want the header to scroll on mobile but for some |
| 17 |
like the editor we need to have a fixed size filling the whole screen. |
| 18 |
For those reports, the .fixed-fullsize-container be used. |
| 19 |
*/ |
| 20 |
|
| 21 |
:root { |
| 22 |
--aside-width: 160px; |
| 23 |
} |
| 24 |
|
| 25 |
body { |
| 26 |
display: grid; |
| 27 |
grid: |
| 28 |
"header header" auto |
| 29 |
"aside main" 1fr |
| 30 |
/ |
| 31 |
var(--aside-width) 1fr; |
| 32 |
width: 100vw; |
| 33 |
height: 100vh; |
| 34 |
padding: 0; |
| 35 |
} |
| 36 |
|
| 37 |
header { |
| 38 |
display: flex; |
| 39 |
flex-wrap: wrap; |
| 40 |
grid-area: header; |
| 41 |
gap: 0.5em; |
| 42 |
align-items: center; |
| 43 |
padding: 0.5em; |
| 44 |
color: var(--header-color); |
| 45 |
background-color: var(--header-background); |
| 46 |
} |
| 47 |
|
| 48 |
article { |
| 49 |
position: relative; |
| 50 |
grid-area: main; |
| 51 |
padding: 1.5em; |
| 52 |
overflow-x: auto; |
| 53 |
} |
| 54 |
|
| 55 |
article:has(> .fixed-fullsize-container) { |
| 56 |
padding: 0; |
| 57 |
} |
| 58 |
|
| 59 |
.fixed-fullsize-container { |
| 60 |
width: 100%; |
| 61 |
max-width: 100vw; |
| 62 |
height: 100%; |
| 63 |
max-height: 100vh; |
| 64 |
} |
| 65 |
|
| 66 |
@media (width <= 767px) { |
| 67 |
article { |
| 68 |
padding: 1em; |
| 69 |
} |
| 70 |
|
| 71 |
body { |
| 72 |
display: block; |
| 73 |
font-size: 16px; |
| 74 |
transition: var(--transitions); |
| 75 |
} |
| 76 |
|
| 77 |
body:has(> article > .fixed-fullsize-container) { |
| 78 |
display: grid; |
| 79 |
grid-template: "header" max-content "main" 1fr; |
| 80 |
} |
| 81 |
|
| 82 |
header { |
| 83 |
padding-left: 50px; |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
@media print { |
| 88 |
body { |
| 89 |
grid-template: "header" max-content "main" 1fr; |
| 90 |
} |
| 91 |
} |