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
## Motivation

The documentation under https://tracing.rs/tracing/ is missing CSS
styles. Fixes #2444 

## Solution

Used the `--html-in-header` rustdoc flag instead of `--extend-css`.
Converted the css file into an html file.
  • Loading branch information
rwakulszowa authored Feb 8, 2023
1 parent 264a417 commit 2ace0b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions assets/warning.css → assets/warning-css.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#tracing-warning-header {
<style>
#tracing-warning-header {
z-index: 400;
position: fixed;
background-color: orange;
Expand All @@ -12,14 +13,15 @@
line-height: 0.6;
padding-top: 10px;
padding-left: 230px;
}
}

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

.sidebar {
.sidebar {
/* add top padding to fit the warning header */
margin-top: 50px !important;
}
}
</style>
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
--cfg docsrs \
--html-before-content /opt/build/repo/assets/warning.html \
--html-in-header /opt/build/repo/assets/noindex.html \
--extend-css /opt/build/repo/assets/warning.css \
--html-in-header /opt/build/repo/assets/warning-css.html \
"""

[[redirects]]
Expand Down

0 comments on commit 2ace0b5

Please sign in to comment.