-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
CSS property update: align-items #34142
Conversation
Preview URLs (comment last updated: 2024-06-17 13:55:36) |
|
||
- `flex-start` | ||
|
||
- : Used in flex layout only, aligns the flex items flush against the flex container's main-start or cross-start side. |
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.
do we have anything to link to from main-start
and cross-start
if a reader doesn't know what they are? Same below for main-end
and cross-end
.
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 linked to the flex model in the sentence above
```css | ||
#container { | ||
:where(#container) { | ||
height: 200px; | ||
width: 240px; |
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.
Want to make it a little wider? 500px container width and 100px wide children?
width: 240px; | |
width: 500px; |
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 call.
div > div { | ||
box-sizing: border-box; | ||
border: 2px solid #fff; | ||
width: 50px; |
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.
See comment above about making it a little wider
width: 50px; | |
width: 100px; |
```html | ||
<div id="container" class="flex"> | ||
<div id="item1">1</div> | ||
<div id="item2">2</div> | ||
<div id="item3">3</div> | ||
<div id="item4">4</div> | ||
<div id="item4">4<br />4</div> |
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.
What do you think about this? I skipped the prose when looking at the live example at first and thought it was a typo.
<div id="item4">4<br />4</div> | |
<div id="item4">4<br />(line break)</div> |
```css | ||
#container { | ||
:where(#container) { |
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.
do we need where()
?
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.
the specificity of the #container
means we can't override any properties with .flex
and .grid
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.
changed to flex, grid
Nice, thank you! A couple of comments for your consideration! |
} | ||
|
||
.flex { | ||
display: flex; | ||
flex-wrap: wrap; | ||
background-color: #8c8c9f; | ||
border-color: magenta; | ||
} | ||
|
||
.grid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, 50px); |
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.
If you think it makes sense to apply the other width changes, I guess we need it here, also
grid-template-columns: repeat(auto-fill, 50px); | |
grid-template-columns: repeat(auto-fill, 100px); |
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.
thanks @bsmth for the review.
|
||
- `flex-start` | ||
|
||
- : Used in flex layout only, aligns the flex items flush against the flex container's main-start or cross-start side. |
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 linked to the flex model in the sentence above
```css | ||
#container { | ||
:where(#container) { |
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.
changed to flex, grid
```css | ||
#container { | ||
:where(#container) { | ||
height: 200px; | ||
width: 240px; |
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 call.
The [CSS](/en-US/docs/Web/CSS) **`align-items`** property sets the {{cssxref("align-self")}} value on all direct children as a group. In Flexbox, it controls the alignment of items on the {{glossary("Cross Axis")}}. In Grid Layout, it controls the alignment of items on the Block Axis within their {{glossary("Grid Areas", "grid area")}}. | ||
|
||
The interactive example below demonstrates some of the values for `align-items` using grid layout. | ||
The [CSS](/en-US/docs/Web/CSS) **`align-items`** property sets the {{cssxref("align-self")}} value on all direct children as a group. In flexbox, it controls the alignment of items on the {{glossary("cross axis")}}. In Grid Layout, it controls the alignment of items on the block axis within their {{glossary("grid area")}}. |
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.
The [CSS](/en-US/docs/Web/CSS) **`align-items`** property sets the {{cssxref("align-self")}} value on all direct children as a group. In flexbox, it controls the alignment of items on the {{glossary("cross axis")}}. In Grid Layout, it controls the alignment of items on the block axis within their {{glossary("grid area")}}. | |
The [CSS](/en-US/docs/Web/CSS) **`align-items`** property sets the {{cssxref("align-self")}} value on all direct children as a group. In flexbox, it controls the alignment of items on the {{glossary("cross axis")}}. In Grid Layout, it controls the alignment of items on the block axis within their {{glossary("Grid Areas", "grid area")}}. |
glossary link here is broken, it looks like it should be "Grid Areas"
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.
Thank you! Nice improvements 👍🏻
There's one Glossary link to fix, but leaving a +1. Well done ✔️
Updates to CSS property align-items:
addressed as part of CSS baseline / interop openwebdocs/project#189 - subcomponent openwebdocs/project#202