Skip to content

Commit

Permalink
docs: fix warning styles in html-in-header (#2449)
Browse files Browse the repository at this point in the history
The documentation under https://tracing.rs/tracing/ is missing CSS
styles. Fixes #2444

Used the `--html-in-header` rustdoc flag instead of `--extend-css`.
Converted the css file into an html file.
  • Loading branch information
rwakulszowa authored and davidbarsky committed Sep 26, 2023
1 parent cbcfbf9 commit 394207a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions assets/warning-css.html
@@ -0,0 +1,27 @@
<style>
#tracing-warning-header {
z-index: 400;
position: fixed;
background-color: orange;
left: 0;
top: 0;
right: 0;
height: 50px;
display: block;
color: black;
font-size-adjust: 0.55;
line-height: 0.6;
padding-top: 10px;
padding-left: 230px;
}

body {
/* add top padding to fit the warning header */
padding-top: 50px !important;
}

.sidebar {
/* add top padding to fit the warning header */
margin-top: 50px !important;
}
</style>
3 changes: 3 additions & 0 deletions netlify.toml
Expand Up @@ -11,6 +11,9 @@
--force-warn renamed-and-removed-lints \
--cfg docsrs \
--cfg tracing_unstable
--html-before-content /opt/build/repo/assets/warning.html \
--html-in-header /opt/build/repo/assets/noindex.html \
--html-in-header /opt/build/repo/assets/warning-css.html \
"""
RUSTFLAGS="--cfg tracing_unstable"

Expand Down

0 comments on commit 394207a

Please sign in to comment.