about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-08-11 06:59:58 -0700
committerJacob Hoffman-Andrews <github@hoffman-andrews.com>2022-08-11 17:00:17 -0700
commitdd4613cbc091860d4b56f506b195b92c87f022a1 (patch)
tree7fde84e81aff1c81461163fe380627704c9a5af8 /src/librustdoc/html/static
parent187654481fd828e495919295369d33827f10e1c4 (diff)
downloadrust-dd4613cbc091860d4b56f506b195b92c87f022a1.tar.gz
rust-dd4613cbc091860d4b56f506b195b92c87f022a1.zip
rustdoc: don't generate DOM element for operator
In our source page highlighting, we were generating `<span class="op">`
tags for all "operators", including e.g. `<` `>` around generic
parameters, `*`, `&`. This contributed significantly to DOM size, but
we don't actually style `.op` except in the ayu theme.

Remove the styles for `.op` in ayu, and stop generating the `<span>`s.

This reduces DOM size of an example page[1] from 265,938 HTML elements
to 242,165 elements, a 9% reduction.

[1]:
https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
Diffstat (limited to 'src/librustdoc/html/static')
-rw-r--r--src/librustdoc/html/static/css/themes/ayu.css4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css
index c42cac59bd6..14a61f72c34 100644
--- a/src/librustdoc/html/static/css/themes/ayu.css
+++ b/src/librustdoc/html/static/css/themes/ayu.css
@@ -239,7 +239,7 @@ details.rustdoc-toggle > summary::before {
 pre.rust .number, pre.rust .string { color: #b8cc52; }
 pre.rust .kw, pre.rust .kw-2, pre.rust .prelude-ty,
 pre.rust .bool-val, pre.rust .prelude-val,
-pre.rust .op, pre.rust .lifetime { color: #ff7733; }
+pre.rust .lifetime { color: #ff7733; }
 pre.rust .macro, pre.rust .macro-nonterminal { color: #a37acc; }
 pre.rust .question-mark {
 	color: #ff9011;
@@ -251,7 +251,7 @@ pre.rust .self {
 pre.rust .attribute {
 	color: #e6e1cf;
 }
-pre.rust .attribute .ident, pre.rust .attribute .op {
+pre.rust .attribute .ident {
 	color: #e6e1cf;
 }