Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

ImgSrcsetDirective - Support Responsive src API #376

@benbraou

Description

@benbraou
  1. Overview of the Issue
    • ImgSrcsetDirective only support srcset.<breakpoint alias>. It should also support using src.<breakpoint alias>
    • Also, the directive should auto-wrap the dom element inside a <picture>
  2. Flex-Layout version v2.0.0-beta.9 (feat(srcset): add srcset directive to inject <source> elements to sup… #366)
  3. Motivation for or Use Case Enhancements suggested by @ThomasBurleson
  4. Browsers and Operating System any
  5. Reproduce the Error N.A
  6. Screenshots N.A
  7. Related Issues feat(srcset): add srcset directive to inject <source> elements to sup… #366 (comment)
  8. Quoting @ThomasBurleson considerations

What happens when the user does NOT wrap the img inside a picture element?
Scenario #1:

<img style="width:auto;"
     src="https://dummyimage.com/400x200/c7c224/000.png&text=default"
     src.md="https://dummyimage.com/500x200/76c720/fff.png&text=md"
     src.sm="https://dummyimage.com/400x200/b925c7/fff.png&text=sm"
     src.lt-sm="https://dummyimage.com/300x200/c7751e/fff.png&text=lt-sm"
     src.gt-lg="https://dummyimage.com/700x200/258cc7/fff.png&text=gt-lg" >

In this case ^ (#1), should we auto-wrap the dom element inside a <picture> node?

Scenario #2:

Use tries to use the src property responsively:

<img style="width:auto;"
     src="https://dummyimage.com/400x200/c7c224/000.png&text=default"
     srcset.md="https://dummyimage.com/500x200/76c720/fff.png&text=md"
     srcset.sm="https://dummyimage.com/400x200/b925c7/fff.png&text=sm"
     srcset.lt-sm="https://dummyimage.com/300x200/c7751e/fff.png&text=lt-sm"
     srcset.gt-lg="https://dummyimage.com/700x200/258cc7/fff.png&text=gt-lg" >

In this case ^ (#2), should we responsively update the src property OR should we convert these
to srcset values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions