* <Picture /> should pass all unrecognized props down to the <img> element
* chore: add changeset
* Adding test coverage for custom <img> attributes
* chore: adding a README note for passing attributes to the picture's img
* Revert "<Picture /> should pass all unrecognized props down to the <img> element"
This reverts commit ce3e33930f
.
* Picture should pass alt text to the img
17 lines
678 B
Text
17 lines
678 B
Text
---
|
|
import socialJpg from '../assets/social.jpg';
|
|
import { Picture } from '@astrojs/image';
|
|
---
|
|
|
|
<html>
|
|
<head>
|
|
<!-- Head Stuff -->
|
|
</head>
|
|
<body>
|
|
<Picture id="social-jpg" src={socialJpg} sizes="(min-width: 640px) 50vw, 100vw" widths={[253, 506]} alt="Social image" />
|
|
<br />
|
|
<Picture id="google" src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" sizes="(min-width: 640px) 50vw, 100vw" widths={[272, 544]} aspectRatio={544/184} alt="Google logo" />
|
|
<br />
|
|
<Picture id='inline' src={import('../assets/social.jpg')} sizes="(min-width: 640px) 50vw, 100vw" widths={[253, 506]} alt="Inline social image" />
|
|
</body>
|
|
</html>
|