From: Jeremy Thomas Date: Thu, 25 Jul 2019 10:04:03 +0000 (+0100) Subject: Add arbitrary ratio docs X-Git-Tag: 0.8.0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb28457c3cea9f188f62836a8b6dd94169aea480;p=thirdparty%2Fbulma.git Add arbitrary ratio docs --- diff --git a/CHANGELOG.md b/CHANGELOG.md index ab7f29150..eb48f2837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Fix #2031, Fix #2483 -> Invalid output when declaring a custom shade map * Fix #2060 -> `height: auto` on HTML `audio` element breaks height of element +### New features + +* #2563 `.image` has a new `.is-fullwidth` modifier + ## 0.7.5 ### Deprecation warning diff --git a/docs/documentation/elements/image.html b/docs/documentation/elements/image.html index e160155f4..ddb44d840 100644 --- a/docs/documentation/elements/image.html +++ b/docs/documentation/elements/image.html @@ -40,6 +40,12 @@ meta: {% endcapture %} +{% capture iframe_ratio %} +
+ +
+{% endcapture %} +

Because images can take a few seconds to load (or not at all), use the .image container to specify a precisely sized container so that your layout isn't broken because of image loading or image errors.

@@ -172,11 +178,23 @@ meta:
-

The .image container will take up the whole width while maintaining the perfect ratio.

+

The .image container will usually take up the whole width while maintaining the perfect ratio. +
If it doesn't, you can force it by appending the is-fullwidth modifier.

{% include elements/anchor.html name="Arbitrary ratios with any element" %} {% include elements/new-tag.html version="0.7.4" %} +
+

+ You can apply a specific ratio on any element other than an img, simply by applying the .has-ratio modifier to a resizable element. +

+

+ For example, you can apply a 16by9 ratio on an iframe. Resize the browser, and you'll see how the ratio is maintained. +

+
+ +{% include elements/snippet.html content=iframe_ratio horizontal=true %} + {% include elements/variables.html type='element' %}