Skip to content

Commit 244d59f

Browse files
committed
feat(website): improve look of tables and figures
Make tables and figures look prettier by default, removing some page-specific CSS along the way.
1 parent e2793c4 commit 244d59f

File tree

5 files changed

+113
-76
lines changed

5 files changed

+113
-76
lines changed

website/public/blog/cpp-vs-rust-build-times/index.ejs.html

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
}
4040
}
4141

42-
figure,
43-
.project-size,
44-
.profile-results {
45-
border-collapse: collapse;
46-
margin-left: auto;
47-
margin-right: auto;
48-
}
49-
5042
figure {
5143
text-align: center;
5244
}
@@ -79,14 +71,12 @@
7971

8072
.project-size tr.subtotal td,
8173
.project-size tr.subtotal th {
82-
border-bottom: 1px solid #aaa;
83-
padding-bottom: 0.5em;
8474
color: #999933;
75+
padding-bottom: 0.5rem;
8576
}
8677
@media (prefers-color-scheme: dark) {
8778
.project-size tr.subtotal td,
8879
.project-size tr.subtotal th {
89-
border-bottom-color: #000;
9080
color: #e4e499;
9181
}
9282
}
@@ -100,6 +90,15 @@
10090
}
10191
}
10292

93+
.project-size tr.subtotal td,
94+
.project-size tr.subtotal th {
95+
border-bottom-style: dashed;
96+
}
97+
.project-size .dependencies tr:first-child td,
98+
.project-size .dependencies tr:first-child th {
99+
border-top-style: dashed;
100+
}
101+
103102
.file-tree,
104103
.file-tree ul {
105104
text-align: left;
@@ -642,26 +641,31 @@ <h3>The rewrite</h3>
642641
<th><abbr title="dependency">dep</abbr>: Google Test</th>
643642
<td>69.7k</td>
644643
<td></td>
644+
<td></td>
645645
</tr>
646646
<tr>
647647
<th>dep: autocfg</th>
648648
<td></td>
649649
<td>0.6k</td>
650+
<td></td>
650651
</tr>
651652
<tr>
652653
<th>dep: lazy_static</th>
653654
<td></td>
654655
<td>0.4k</td>
656+
<td></td>
655657
</tr>
656658
<tr>
657659
<th>dep: libc</th>
658660
<td></td>
659661
<td>88.6k</td>
662+
<td></td>
660663
</tr>
661664
<tr>
662665
<th>dep: memoffset</th>
663666
<td></td>
664667
<td>0.6k</td>
668+
<td></td>
665669
</tr>
666670
</tbody>
667671
</table>
@@ -1280,7 +1284,7 @@ <h3 id="optimizing-rust-with-lighter-dependencies">
12801284
The <code>libc</code> crate has a feature called <code>std</code>. Let's
12811285
turn it off, test it, and see if build times improve:
12821286

1283-
<figure style="width: 28em">
1287+
<figure style="max-width: 29em">
12841288
<figcaption>Cargo.toml</figcaption>
12851289
<pre class="diff"><code> [dependencies]
12861290
<ins>libc = { version = "0.2.138", default-features = false }</ins>
@@ -1316,7 +1320,7 @@ <h3 id="optimizing-rust-with-cargo-nextest">cargo-nextest</h3>
13161320
On my Linux machine, cargo-nextest either doesn't help or makes things
13171321
worse. The output does look pretty, though...
13181322

1319-
<figure style="width: 40em">
1323+
<figure style="max-width: 43.5em">
13201324
<figcaption>sample cargo-nextest test output</figcaption>
13211325
<pre><font color="#859900"><b>PASS</b></font> [ 0.002s] <font color="#D33682"><b> cpp_vs_rust::test_locale</b></font> <font color="#268BD2"><b>no_match</b></font>
13221326
<font color="#859900"><b>PASS</b></font> [ 0.002s] <font color="#D33682"><b> cpp_vs_rust::test_offset_of</b></font> <font color="#268BD2"><b>fields_have_different_offsets</b></font>

website/public/blog/syntax-errors-2021/index.ejs.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@
138138
text-align: left;
139139
}
140140

141+
table .engine th,
142+
table .engine td {
143+
border: 0;
144+
}
145+
141146
figure {
142147
margin: 0;
143148
}
@@ -178,10 +183,6 @@
178183
background-color: rgba(0, 0, 0, 0.1);
179184
}
180185
}
181-
.code-example figcaption {
182-
font-style: italic;
183-
margin-top: 0.5rem;
184-
}
185186
.code-example figcaption a:link:not(:hover) {
186187
text-decoration: none;
187188
}

0 commit comments

Comments
 (0)