-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
responsive images stable #11741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
responsive images stable #11741
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
src/content/docs/en/reference/experimental-flags/responsive-images.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/responsive-images.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/en/reference/experimental-flags/responsive-images.mdx
Outdated
Show resolved
Hide resolved
|
Updated the main PR description with this checkbox! |
…yet deleted) Co-authored-by: Matt Kane <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ascorbic I've left two suggestions here for handling image.responsiveStyles
being true by default.
Specifically, the focus isn't on overriding the defaults anymore, but rather making sure it's clear people should opt in, and when they should avoid enabling it. Also a generic Tailwind 4 section is probably more helpful now (Yes, you can use responsive images with Tailwind 4! Here's how it works...) because the focus is not strictly about overriding.
Please feel free to edit as necessary!
Co-authored-by: Sarah Rainsberger <[email protected]>
} | ||
}); | ||
``` | ||
You can override the `object-fit` and `object-position` styles on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can override the `object-fit` and `object-position` styles on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. | |
You can override the `object-fit` and `object-position` styles on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. These props also change the way the images are cropped, so you should still use them, even if you apply your own styles. |
I think this is improtant to note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Addressed in the next comment)
} | ||
}); | ||
``` | ||
You can override the `object-fit` and `object-position` styles on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can override the `object-fit` and `object-position` styles on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. | |
The `object-fit` and `object-position` styles determine how your images are cropped to fit their container and are essential for creating responsive images. You can override your default configuration or custom styles and provide your own styling for these properties on a per-image basis by setting the `fit` and `position` props on the `<Image />` or `<Picture />` component. |
How about this, @ascorbic ? Is this "you must use them" strongly enough?
I think this PR has all the pieces now! (Will need a Lunaria commit message at merge) Most recent commit adds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job. Just a few small nits. PS: This PR shouldn't need a Lunaria tracking directive, since we are not doing anything special here.
Co-authored-by: Yan <[email protected]>
Co-authored-by: Yan <[email protected]>
Description (required)
Un-experimentalizes responsive images!
Moves the responsive image docs (properties, guide, reference, explanations) to the proper locations throughout the stable docs.
In particular:
astro:assets
module pageexperimental
image.responsiveStyles
content from Add note on disabling default styles #11787 and feat: unflag responsive images astro#13917 (renamed fromimage.defaultStyles
, defaults tofalse
)priority
option from feat: unflag responsive images astro#13917Additionally, with the addition of new image content, the Image Guide itself has been slightly reorganized and lightly edited with some overall improvements:
**Options:**
list at the start of each of these sections so that at a glance, it is easy to tell which image methods are available in that file type<h2>
to group all the "components" (<Image />
,<Picture />
, SVGs as components, creating a custom component (e.g.<BlogPostImage />
) for easy reuse of images that share default settings), and removing this content from within the "Images in.astro
files" section.astro
files. This draft instead optimizes for quickly identifying your image options based on the file type, but no longer provides all that content within that section. This allows readers to quickly see and compare how different file types work, and find the details later on the page in a dedicated section for components.Related issues & labels (optional)
For Astro version:
5.10
. See astro PR #13917. // will fill in when known