diff --git a/docs/_includes/carousel.html b/docs/_includes/carousel.html index a4ecb1574e..d9b1c95b32 100644 --- a/docs/_includes/carousel.html +++ b/docs/_includes/carousel.html @@ -11,22 +11,36 @@ diff --git a/docs/docs/app/index.md b/docs/docs/app/index.md index f8cdb49922..edc8e90f75 100644 --- a/docs/docs/app/index.md +++ b/docs/docs/app/index.md @@ -2,7 +2,7 @@ title: InvenTree Mobile App --- -{% with directory="appgallery", per_page=2 %} +{% with directory="appgallery", per_page=2, height="25rem", mobile_height="25rem" %} {% include "carousel.html" %} {% endwith %} diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css index 953ba68227..771e559d28 100644 --- a/docs/docs/stylesheets/extra.css +++ b/docs/docs/stylesheets/extra.css @@ -183,3 +183,18 @@ div:nth-of-type(1) p:not(.admonition-title) { .api-method-patch { background-color: #9c36b5; } .api-method-delete { background-color: #c92a2a; } .api-method-head, .api-method-options { background-color: #495057; } + +/* Image carousel: scale every image to the slide height, keeping aspect ratio */ +.splide__slide { + display: flex; + align-items: center; + justify-content: center; +} + +.splide__slide img { + height: 100%; + width: auto; + /* Very wide images shrink to fit the carousel on narrow screens */ + max-width: calc(100vw - 2rem); + object-fit: contain; +}