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

LibWeb: Support flex-basis: calc(...)

1. Propagate calc() values from StyleProperties to ComputedValues.
2. Actually resolve calc() values when determining the used flex basis.

This makes the "support" section on https://shopify.com/ show up
correctly as a 2x2 grid (instead of 1x4). :^)
This commit is contained in:
Andreas Kling 2023-05-16 16:59:47 +02:00
parent e81d4ca1ac
commit 2e13f65ff4
4 changed files with 59 additions and 4 deletions

View file

@ -0,0 +1,18 @@
<!doctype html><style>
* {
border: 1px solid black;
box-sizing: border-box;
font: 20px SerenitySans;
}
.flex-container {
display: flex;
flex-wrap: wrap;
background: pink;
column-gap: 1px;
}
.flex-item {
flex-basis: calc(50% - 1px);
background: orange;
height: 30px;
}
</style><div class="flex-container"><div class="flex-item">Item 1</div><div class="flex-item">Item 2</div><div class="flex-item">Item 3</div><div class="flex-item">Item 4</div></div>