Skip to content

Commit

Permalink
Attempt to fix double box-shadow on figures
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Jan 25, 2024
1 parent 9c5b28f commit b9eaccb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/dashboards.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ editor:
Shiny's UI [components](/components) and [layouts](/layouts) can be used to create a wide range of apps, including dashboards.
In this article, we'll highlight some of the most useful components for creating dashboard, and eventally show how to create [this sophisticated dashboard](#altogether-now):

![A Shiny dashboard with visuals for exploring restaurant tips (see [here](#altogether-now) for the code).](assets/tipping-dashboard.png){class="img-fluid shadow rounded"}
![A Shiny dashboard with visuals for exploring restaurant tips (see [here](#altogether-now) for the code).](assets/tipping-dashboard.png){class="img-shadow"}

::: callout-tip
## Different layouts
Expand Down
2 changes: 1 addition & 1 deletion docs/install-create-run.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ The best way to create a new Shiny app is with the `shiny create` command line i
shiny create
```

![Running the shiny create command from a terminal](assets/shiny-create.mp4){class="img-fluid shadow rounded"}
![Running the shiny create command from a terminal](assets/shiny-create.mp4){class="img-shadow"}

::: callout-tip
### Copy/paste examples
Expand Down
4 changes: 2 additions & 2 deletions docs/quick-start.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Welcome to the Shiny quick start guide!
After reading this article, you'll be able to get started creating basic Shiny apps.
In later articles, we'll build on these concepts to create more advanced apps, like the following dashboard:

![A Shiny dashboard with visuals for exploring restaurant tips (covered in the [next article](dashboards.qmd)).](assets/tipping-dashboard.png){class="img-fluid shadow rounded"}
![A Shiny dashboard with visuals for exploring restaurant tips (covered in the [next article](dashboards.qmd)).](assets/tipping-dashboard.png){class="img-shadow"}


### Basics {#basics}
Expand Down Expand Up @@ -533,7 +533,7 @@ Once you've [installed](install-create-run.qmd) Shiny, the `shiny create` CLI co
shiny create -t dashboard
```

![The resulting dashboard generated by the dashboard template](assets/dashboard-template.png){class="img-fluid shadow rounded"}
![The resulting dashboard generated by the dashboard template](assets/dashboard-template.png){class="img-shadow"}

::: {.callout-tip}
## Example gallery
Expand Down
2 changes: 1 addition & 1 deletion docs/reactive-patterns.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def table():
return render.DataGrid(df())
```

![A gif of uploading a csv file and seeing the text and table outputs update](assets/file-upload.mp4){class="img-fluid shadow rounded" style="margin-top: -1.5rem;"}
![A gif of uploading a csv file and seeing the text and table outputs update](assets/file-upload.mp4){class="img-shadow" style="margin-top: -1.5rem;"}


## Scheduled invalidation {#invalidate-later}
Expand Down
9 changes: 8 additions & 1 deletion quarto-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,14 @@ pre.console {
0px 12px 30px rgb(0 0 0 / 8%);
}

// For some reason, quarto wants to add classes to both img and figure when
// classes are provided. This is a hack to just get a shadow on the image, if requested.
img, video {
&.img-shadow {
@extend .shadow;
}
}

code.sourceCode,
pre.console code {
padding: 0.5rem;
Expand Down Expand Up @@ -1865,4 +1873,3 @@ body:not(.modal-open) div.sourceCode:hover pre {
padding-right: 0.4rem !important;
}
}

0 comments on commit b9eaccb

Please sign in to comment.