diff --git a/inst/BS5/assets/pkgdown.scss b/inst/BS5/assets/pkgdown.scss index 8d3db061b..18ea7a26f 100644 --- a/inst/BS5/assets/pkgdown.scss +++ b/inst/BS5/assets/pkgdown.scss @@ -649,17 +649,22 @@ pre div.gt-table { // "Pop" code out of page margins on small screens to give a little more room @include media-breakpoint-down(sm) { + // Same radius to all blocks even if no space is added for consistency + div>pre { + border-radius: 0; + } + // div.section div.sourceCode pre - // prevents matching
inside (e.g.) a
inside (e.g.) a
+ :not(li,blockquote)>div>pre { margin-left: calc(var(--bs-gutter-x) * -.5); margin-right: calc(var(--bs-gutter-x) * -.5); - border-radius: 0; padding-left: 1rem; padding-right: 1rem; } - .btn-copy-ex { + // Relocate button for selected elements + :not(li,blockquote)>div>.btn-copy-ex { right: calc(var(--bs-gutter-x) * -.5 + 5px); } } diff --git a/vignettes/test/rendering.Rmd b/vignettes/test/rendering.Rmd index 11cc8506d..96bc8f286 100644 --- a/vignettes/test/rendering.Rmd +++ b/vignettes/test/rendering.Rmd @@ -112,6 +112,63 @@ Non-R code in `\preformatted{}` yaml: [a, b, c] ``` +### `pre` blocks + +Testing margins and copy buttons on small screens. + +```r +txt <- "Not wrapped; check the copy button behavior." +``` + ++ +Wrapped in a ` ` (e.g. `section > div > pre`) + +```r +txt <- "Wrapped in section" +``` + + + +> This is a blockquote with enough text to test the width of the code block and +> verify whether it aligns with the paragraph width. +> +> ```r +> txt <- "Wrapped in blockquote; margins are preserved." +> ``` +> +> Continue… + +- This list item includes enough text to test the width of the code block and + check whether it matches the paragraph width. + + ```r + txt <- "Wrapped in li; margins are preserved." + ``` + +- Another bullet. + + 1. Nested list. + + 2. Second level item with enough text to test the width of the code block + and confirm alignment with the paragraph. + + ```r + txt <- "Wrapped in li; margins are preserved." + ``` + + 3. Nested list continues. + ++ ++ ### Crayon ```{r}`
+ +```r +txt <- "Wrapped in details" +``` + +` block inside a `` element.