Fix square corners on line numbers when code is collapsed

This commit is contained in:
Guillaume Gomez 2024-09-03 22:17:04 +02:00
parent 55bc638a1d
commit 7157f98cb4
2 changed files with 15 additions and 2 deletions

View File

@ -746,7 +746,8 @@ ul.block, .block li {
} }
.rustdoc .example-wrap > pre, .rustdoc .example-wrap > pre,
.rustdoc .scraped-example .src-line-numbers { .rustdoc .scraped-example .src-line-numbers,
.rustdoc .scraped-example .src-line-numbers > pre {
border-radius: 6px; border-radius: 6px;
} }
@ -755,7 +756,8 @@ If the code example line numbers are displayed, there will be a weird radius in
both the code example and the line numbers, so we need to remove the radius in this case. both the code example and the line numbers, so we need to remove the radius in this case.
*/ */
.rustdoc .example-wrap > .example-line-numbers, .rustdoc .example-wrap > .example-line-numbers,
.rustdoc .scraped-example .src-line-numbers { .rustdoc .scraped-example .src-line-numbers,
.rustdoc .scraped-example .src-line-numbers > pre {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }

View File

@ -108,6 +108,17 @@ assert-local-storage: {"rustdoc-line-numbers": "true" }
// Same check with scraped examples line numbers. // Same check with scraped examples line numbers.
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html" go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
assert-css: (
".scraped-example .src-line-numbers > pre",
{
// There should not be a radius on the right of the line numbers.
"border-top-left-radius": "6px",
"border-bottom-left-radius": "6px",
"border-top-right-radius": "0px",
"border-bottom-right-radius": "0px",
},
ALL,
)
assert-css: ( assert-css: (
".scraped-example .src-line-numbers", ".scraped-example .src-line-numbers",
{ {