1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

LibWeb: Resolve grid items preferred width in GFC

Previously, the width and height of grid items were set to match the
size of the grid area they belonged to. With this change, if a grid
item has preferred width or height specified to not "auto" value it
will be resolved using grid area as containing block and used instead.
This commit is contained in:
Aliaksandr Kalenik 2023-05-11 17:46:22 +03:00 committed by Andreas Kling
parent c2f6ba8f5f
commit de970c2dce
5 changed files with 67 additions and 2 deletions

View file

@ -0,0 +1,13 @@
<style>
.grid-container {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: auto;
}
.first {
background-color: lightcoral;
width: 100px;
height: 200px;
}
</style><div class="grid-container"><div class="first">First</div></div>

View file

@ -0,0 +1,17 @@
<style>
.grid-container {
display: grid;
grid-template-columns: auto auto;
grid-template-rows: auto;
}
.first {
background-color: lightcoral;
width: 80%;
}
.second {
background-color: lightsteelblue;
width: 20%;
}
</style><div class="grid-container"><div class="first">First</div><div class="second">Second</div></div>