Skip to content

Commit 2db5097

Browse files
ybiquitousnobu
authored andcommitted
Improve layout CSS
- Use the `grid` property for the page layout. - https://caniuse.com/css-grid - Adjust the `<main>` margin. - Make the sidebar responsive and resizable. - https://caniuse.com/css-math-functions - https://caniuse.com/css-resize Note all modern browsers support the new CSS properties and functions used by this change.
1 parent a96d349 commit 2db5097

File tree

1 file changed

+16
-5
lines changed
  • lib/rdoc/generator/template/darkfish/css

1 file changed

+16
-5
lines changed

lib/rdoc/generator/template/darkfish/css/rdoc.css

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ body {
1717
background: #fafafa;
1818
font-family: Lato, sans-serif;
1919
font-weight: 300;
20+
21+
/* Layout */
22+
display: grid;
23+
grid-template-columns: auto 1fr;
24+
}
25+
26+
body > :last-child {
27+
grid-column: 1 / 3;
2028
}
2129

2230
h1 span,
@@ -181,21 +189,25 @@ table tr:nth-child(even) td {
181189
/* @group Top-Level Structure */
182190

183191
nav {
184-
float: left;
185-
width: 260px;
186192
font-family: Helvetica, sans-serif;
187193
font-size: 14px;
188194
border-right: 1px solid #ccc;
189195
position: sticky;
190196
top: 0;
191197
overflow: auto;
198+
199+
/* Layout */
200+
width: 260px; /* fallback */
201+
width: max(50px, 20vw);
202+
min-width: 50px;
203+
max-width: 80vw;
192204
height: calc(100vh - 100px); /* reduce the footer height */
205+
resize: horizontal;
193206
}
194207

195208
main {
196209
display: block;
197-
margin: 0 2em 5em 260px;
198-
padding-left: 20px;
210+
margin: 1em;
199211
min-width: 340px;
200212
font-size: 16px;
201213
}
@@ -214,7 +226,6 @@ main h6 {
214226
}
215227

216228
#validator-badges {
217-
clear: both;
218229
margin: 1em 1em 2em;
219230
font-size: smaller;
220231
}

0 commit comments

Comments
 (0)