-
Notifications
You must be signed in to change notification settings - Fork 107
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
Accurate sizes: Support relative alignment widths #1737
Accurate sizes: Support relative alignment widths #1737
Conversation
Thanks for fixing those indents, @mukeshpanchal27! Some times my editor's auto-formatting takes on a life of it's own 😅 I'm going to add some unit tests for this (current tests are still passing) and then I this should be ready for review as well. |
Co-authored-by: Weston Ruter <[email protected]>
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
aa340dc
into
feature/1511-incorporate-layout-constraints-from-ancestors
Summary
This is an initial concept for supporting relative alignment widths as described in #1511 (comment).
Relevant technical choices
If the layout setting ends in a px value, compare directly with the image width. If the layout setting uses any other value, use a CSS
min()
function insizes
.This also improves the logic for left/right alignment values so they are constrained by
wide
layouts if the image width is larger than the container.To test
30rem
sizes
value looks similar tosizes="(max-width: min(20rem, 1024px)) 100vw, min(20rem, 1024px)"