-
Notifications
You must be signed in to change notification settings - Fork 133
Add Feature Box Alignment of abspos elements #2947
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
Open
jamesnw
wants to merge
2
commits into
web-platform-dx:main
Choose a base branch
from
oddbird:abspos-box
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Box alignment of absolute positioned elements | ||
description: The `align-self` and `justify-self` properties, and their `place-self` shorthand, align an absolute positioned element within its containing block, outside of a flex or grid layout. | ||
spec: https://drafts.csswg.org/css-align/#justify-abspos | ||
group: positioning | ||
compat_features: | ||
- css.properties.place-self.position_absolute_context | ||
- css.properties.align-self.position_absolute_context | ||
- css.properties.justify-self.position_absolute_context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Generated from: absolute-positioning-box-alignment.yml | ||
# Do not edit this file by hand. Edit the source file instead! | ||
|
||
status: | ||
baseline: false | ||
support: | ||
chrome: "122" | ||
chrome_android: "122" | ||
edge: "122" | ||
firefox: "134" | ||
firefox_android: "134" | ||
compat_features: | ||
- css.properties.align-self.position_absolute_context | ||
- css.properties.justify-self.position_absolute_context | ||
- css.properties.place-self.position_absolute_context |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I find this name a bit long, and I wonder if developers are going to easily associate it to what the feature is about.
How about "Absolute positioning alignment"?
Unfortunately, I can't find much resources online that talk about this. I was hoping to find a commonly accepted feature name, but no.
The only thing I could find is my own (now outdated) css alignment cheatsheet.
But, reading it again, I think the scope of this feature here is different, and I'm finding myself a bit confused by all of the ways in which the align-* and justify-* properties can be used.
The feature you are proposing is specifically about absolute positioning. When I tested it, I found that
justify-self
seems to work fine (i.e. setting it tocenter
does center the absolutely positioned box within its container), butalign-self
is surprising (e.g. to center the box, I need to use the valueanchor-center
ascenter
doesn't do what I expect it to do).Is there also a feature we should be creating about aligning elements within a block layout (as opposed to aligning them within a grid, or flex layout)?
For example, we already have align-content in block layouts. I wonder if we should expand this feature to be more generally about alignment within block layouts. Indeed, while
align-content
does work like padding, when set on the container block layout, there's alsojustify-items
(orjustify-self
on children elements) which works kind of like margin and can be used to align elements along the inline axis. See https://patrickbrosset.com/lab/alignment-in-blocks/ and its source code.