Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions inst/BS5/assets/pkgdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pre> inside (e.g.) a <li>
div>div>pre {
// prevents matching <pre> inside (e.g.) a <li> and <blockquote>
: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);
}
}
Expand Down
57 changes: 57 additions & 0 deletions vignettes/test/rendering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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."
```

<section>

Wrapped in a `<section>` (e.g. `section > div > pre`)

```r
txt <- "Wrapped in section"
```

</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.

<details>

<summary>`<pre>` block inside a `<details>` element.</summary>

```r
txt <- "Wrapped in details"
```

</details>

### Crayon

```{r}
Expand Down