• J
    Improve page load performance in rustdoc. · d3e7ffa7
    Jacob Hoffman-Andrews 提交于
    Add font-display: swap. Per https://web.dev/font-display/, this prevents
    "flash of invisible text" during load by using a system font until the
    custom font is available. I've noticed this flash of invisible text
    occasionally when reading Rust docs.
    
    Add an explicit height to icons (which already had an explicit width)
    to allow browsers to lay out the page more accurately before the icons
    have been loaded. https://web.dev/optimize-cls/.
    
    Add min-width: 115px to the crate search dropdown. When the HTML first
    loads, this dropdown includes only the text "All crates." Later, JS
    loads the items underneath it, some of which are wider. That causes
    the dropdown to get wider, causing a distracting reflow. This sets a
    min-width based on the size that the dropdown eventually becomes based
    on the crates on doc.rust-lang.org, reducing page movement during load.
    d3e7ffa7
rustdoc.css 29.3 KB