summaryrefslogtreecommitdiff
path: root/addons/web/static/src/scss/ui.scss
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/scss/ui.scss')
-rw-r--r--addons/web/static/src/scss/ui.scss38
1 files changed, 38 insertions, 0 deletions
diff --git a/addons/web/static/src/scss/ui.scss b/addons/web/static/src/scss/ui.scss
index 9ab1729a4ac..5a46c9c01a8 100644
--- a/addons/web/static/src/scss/ui.scss
+++ b/addons/web/static/src/scss/ui.scss
@@ -91,3 +91,41 @@ span.o_force_ltr {
/*rtl:ignore*/
direction: ltr;
}
+
+// To fill the available space while keeping aspect ratio (crop).
+// Assuming the important part of the image is its center.
+.o_object_fit_cover {
+ object-fit: cover;
+}
+
+.o_image_24_cover {
+ width: 24px;
+ height: 24px;
+ object-fit: cover;
+}
+
+.o_image_40_cover {
+ width: 40px;
+ height: 40px;
+ object-fit: cover;
+}
+
+.o_image_64_cover {
+ width: 64px;
+ height: 64px;
+ object-fit: cover;
+}
+
+// Keep ratio but avoid cropping (so part of the background becomes visible).
+.o_image_64_contain {
+ width: 64px;
+ height: 64px;
+ object-fit: contain;
+}
+
+// When having a square is not necessary, the image will take less space if any
+// of its width or height is smaller than 64px.
+.o_image_64_max {
+ max-width: 64px;
+ max-height: 64px;
+}