From: Pieter Jan De Smedt Date: Wed, 24 Jan 2018 17:57:04 +0000 (+0100) Subject: Add some common photography aspect ratios (5:4, 5:3, 3:1) and all aspect ratio portra... X-Git-Tag: 0.7.0~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6bfc1a61f76a93fc5555772bf7a0e4b7d0de9c84;p=thirdparty%2Fbulma.git Add some common photography aspect ratios (5:4, 5:3, 3:1) and all aspect ratio portrait counterparts --- diff --git a/docs/documentation/elements/image.html b/docs/documentation/elements/image.html index cf7c03286..1cd6b4495 100644 --- a/docs/documentation/elements/image.html +++ b/docs/documentation/elements/image.html @@ -77,7 +77,7 @@ dimensions: {% include anchor.html name="Responsive images with ratios" %}
-

If you don't know the exact dimensions but know the ratio instead, you can use one of the 5 ratio modifiers:

+

If you don't know the exact dimensions but know the ratio instead, you can use one of the 16 ratio modifiers, which include [common aspect ratios in still photography](https://en.wikipedia.org/wiki/Aspect_ratio_(image)#Still_photography):

@@ -85,13 +85,18 @@ dimensions: - + + + + + + @@ -102,6 +107,11 @@ dimensions: + + + + + @@ -112,7 +122,47 @@ dimensions: - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
image is-square
Square (or 1by1)Square (or 1 by 1)
image is-1by1
1 by 1
image is-5by4
5 by 4
image is-4by3
3 by 2
image is-5by3
5 by 3
image is-16by9
2 by 1
image is-3by1
3 by 1
image is-4by5
4 by 5
image is-3by4
3 by 4
image is-2by3
2 by 3
image is-3by5
3 by 5
image is-9by16
9 by 16
image is-1by2
1 by 2
image is-1by3
1 by 3
diff --git a/sass/elements/image.sass b/sass/elements/image.sass index 52b7a1ca5..10bad209f 100644 --- a/sass/elements/image.sass +++ b/sass/elements/image.sass @@ -12,10 +12,20 @@ $dimensions: 16 24 32 48 64 96 128 !default // Ratio &.is-square, &.is-1by1, + &.is-5by4, &.is-4by3, &.is-3by2, + &.is-5by3, &.is-16by9, - &.is-2by1 + &.is-2by1, + &.is-3by1, + &.is-4by5, + &.is-3by4, + &.is-2by3, + &.is-3by5, + &.is-9by16, + &.is-1by2, + &.is-1by3 img +overlay height: 100% @@ -23,14 +33,34 @@ $dimensions: 16 24 32 48 64 96 128 !default &.is-square, &.is-1by1 padding-top: 100% + &.is-5by4 + padding-top: 80% &.is-4by3 padding-top: 75% &.is-3by2 padding-top: 66.6666% + &.is-5by3 + padding-top: 60% &.is-16by9 padding-top: 56.25% &.is-2by1 padding-top: 50% + &.is-3by1 + padding-top: 33.3333% + &.is-4by5 + padding-top: 125% + &.is-3by4 + padding-top: 133.3333% + &.is-2by3 + padding-top: 150% + &.is-3by5 + padding-top: 166.6666% + &.is-9by16 + padding-top: 177.7777% + &.is-1by2 + padding-top: 200% + &.is-1by3 + padding-top: 300% // Sizes @each $dimension in $dimensions &.is-#{$dimension}x#{$dimension}