-
Notifications
You must be signed in to change notification settings - Fork 772
add new API fxSrc for responsive features Image element #81
Comments
I had a similar need in a personal project using @angular/flex-layout. <picture>
<source [flexMedia]="'xs'" srcset="https://dummyimage.com/300x200/d607d6/fff.png&text=xs">
<source [flexMedia]="'md'" srcset="https://dummyimage.com/500x300/0820d4/fff.png&text=md">
<img src="https://dummyimage.com/600x400/ffffff/000000.png&text=default" style="width:auto;">
</picture> But, I just found out about this issue. Thanks |
@benbraou - YES! plz submit a PR and let's get this feature into the core of @angular/flex-layout.
<picture>
<img style="width:auto;"
src="https://dummyimage.com/600x400/ffffff/000000.png"
srcset.xs="https://dummyimage.com/300x200/d607d6/fff.png"
srcset.md="https://dummyimage.com/500x300/0820d4/fff.png" >
</picture> Where
|
Thanks for the quick reply! |
I am working on this issue this weekend. |
I'm so looking forward to seeing this. 😁 |
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes angular#81.
…port responsive images Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> element. Closes #81.
Inject a <source> element for every `srcset.<breakpoint alias>` in the HTML markup of an <img> element contained in a <picture> element. Closes #81.
Support responsive image by introducing srcset.<breakpoint alias> directive. When used as <img> attributes where * where the <img> is a child of a <picture> container, this directive will injects a <source> element for every srcset.<breakpoint alias>. * where the <img> is NOT nested in a <picture> element, then the `img.src` property will be responsively updated. > Thanks to @benbraou for his initial PR submission (@see #366) Closes #81.
* add ImgSrcsetDirective * to inject <source> elements to support responsive images * Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> elemen * support usages without `<picture>` parents * add responsive API to img.src: src.md, src.lt-lg, src.gt-xs, etc. * repackage API classes to easily distinguish flexbox APIs and extended responsive APIs Closes #366, Fixes #81, Fixes #376.
* add ImgSrcsetDirective * to inject <source> elements to support responsive images * Inject a <source> element for every srcset.<breakpoint alias> in the HTML markup of an <img> element contained in a <picture> elemen * support usages without `<picture>` parents * add responsive API to img.src: src.md, src.lt-lg, src.gt-xs, etc. * skip actions if responsive keys are not defined * without responsive keys (`src.<alias>`) defined, the ImgSrcDirective should *fall-through* and not change any attributes or properties on the `img` DOM element. The `img.src` attribute is dynamically set only when responsive keys are defined. * defaults to `src=""` if not explicitly assigned * responsive key activation will then assign the activated value to `img.src` attribute. Closes #366, Fixes #81, Fixes #376.
* add responsive API to img[src.md], img[src.lt-lg], img[src.gt-xs], etc. * skip actions if responsive keys are not defined * without responsive keys (`src.<alias>`) defined, the ImgSrcDirective should **fall-through** and not change any attributes or properties on the `img` DOM element. The `img.src` attribute is dynamically set only when responsive keys are defined. * defaults to `src=""` if not explicitly assigned * responsive key activation will then assign the activated value to `img.src` attribute. Closes #366, Fixes #81, Fixes #376.
* add responsive API to img[src.md], img[src.lt-lg], img[src.gt-xs], etc. * skip actions if responsive keys are not defined * without responsive keys (`src.<alias>`) defined, the ImgSrcDirective should **fall-through** and not change any attributes or properties on the `img` DOM element. The `img.src` attribute is dynamically set only when responsive keys are defined. * defaults to `src=""` if not explicitly assigned * responsive key activation will then assign the activated value to `img.src` attribute. Closes #366, Fixes #81, Fixes #376.
@ThomasBurleson |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Similar to responsive features in the picture element
The text was updated successfully, but these errors were encountered: