You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will render the ``img`` with the URLs of all scales configured in Plone, calculating the width
476
478
of each of the scales and will add the ``sizes="90vw"`` attribute.
477
479
The ``sizes`` attribute instructs the browser to render
478
-
the image that best fits as it will take the 90% of the current viewport-width" whichever is the current
479
-
viewport.
480
+
the image that best fits, as it will take 90% of the current viewport width.
481
+
482
+
This means that, for bigger screens, the browser will download a bigger scaled image, while for smaller screens, a smaller scaled image is enough.
480
483
481
-
This will mean that for bigger screens the browser will download a bigger image while in small screens
482
-
a smaller scale is enough.
484
+
This also means that the developer does not need to worry about creating a specific scale.
485
+
They only need to provide the correct media query to signal the required width.
483
486
484
-
This also means that the developer does not need to worry on creating a specific scale, they only need to
485
-
provide the correct media query to signal the required width.
487
+
The ``scrset`` method of the ``@@images`` view also takes all other parameters that can be rendered in the ``img`` tag, such as ``title``, ``alt``, or ``loading``:
486
488
487
-
The `scrset` method of the `@@images` view takes also all other parameters that can be rendered in the `img`
488
-
tag such as `title`, `alt` or `loading`:
489
+
.. code-block:: xml
489
490
490
491
491
492
<imgtal:define="images context/@@images;"
@@ -495,6 +496,7 @@ tag such as `title`, `alt` or `loading`:
495
496
css_class='rounded-img')" />
496
497
497
498
498
-
*NOTE*: while using this approach may be useful for projects, using it in reusable addons is not recommended
499
-
because it may require overriding it to your needs in a project. For such cases, we recommend using configurable
500
-
picture variants.
499
+
.. note::
500
+
501
+
While using this approach may be useful for projects, using it in reusable add-ons is not recommended, because it may require overriding it to your needs in a project.
502
+
For such cases, use configurable picture variants instead.
0 commit comments