Skip to content

Make Origami lazy loading use native lazy attribute #1306

@benwallman

Description

@benwallman

Origami was written prior to the implementation of lazy loading of image attributes.

https://caniuse.com/loading-lazy-attr

By adding loading="lazy" to img elements, the browser automatically defers loading until the image is nearly on display.

This currently has 93% browser support, and is backwards compatible where older browsers will just download the image, ignoring the attribute.

We can continue with the current approach for old browsers with a browser check, or we can remove our custom lazy loading for images entirely: https://stackoverflow.com/questions/58043418/check-native-browser-support-for-lazy-loading-images

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions