Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Percentage size flex items in border-box container are sized incorrectly #423

@DRKV333

Description

@DRKV333

This is a followup from #422.

The size of percentage sized flex items in a border-box container is calculated relative to the container's border box size, but it should be relative to the container's inner size.

Example

<!DOCTYPE html>
<html>
    <head>
        <style>
            .flexbox {
                display: flex;
                flex-direction: column;
                justify-content: space-around;
                height: 500px;
                width: 300px;
                padding: 100px;
                box-sizing: border-box;
                background-color: blue;
            }

            .test {
                flex-grow: 0;
                flex-basis: 50%;
                box-sizing: content-box;
                background-color: red;
            }
        </style>
    </head>
    <body>
        <div class="flexbox">
            <div class="test">test</div>
        </div>
    </body>
</html>

Expected:
Image

Actual:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions