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:
parent
c2f6ba8f5f
commit
de970c2dce
5 changed files with 67 additions and 2 deletions
13
Tests/LibWeb/Layout/input/grid/grid-item-fixed-size.html
Normal file
13
Tests/LibWeb/Layout/input/grid/grid-item-fixed-size.html
Normal 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>
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue