-
Notifications
You must be signed in to change notification settings - Fork 115
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
Support box-sizing: content-box
#289
Comments
This appears to be the requested feature: https://www.w3schools.com/css/css3_box-sizing.asp Is that correct? :) |
It definitely is! Taffy is using the "border-box" value of that property, meanwhile the default is "content-box" (the one that inflates elements based on padding/ border) |
Got it! IMO we should implement this choice and change our default behavior then. Are you up for a PR? |
This is a worthwhile feature, but I don't think it will be a small change. This will involve updating everywhere that a
It mostly is (indeed I believe this is set in our gentests), and I based my CSS Grid implementation on this assumption. But there are issues on the Yoga repo suggesting that it doesn't entirely follow either content-box or border-box, and I wouldn't be at all surprised if that is true of Taffy's Flexbox implementation too.
Perhaps, but that would be up for debate I think. "content-box" is the default for browsers. But most of the web is using a "CSS reset" (e.g. normalize.css) that sets this back to "border-box". A small historical note: "border-box" was how Internet Explorer worked. "content-box" was how Netscape worked. And while "content-box" was standardised, I think most people think that "border-box" is generally better and more intuitive way of styling things (because otherwise if you add padding or border to a box that is 100px wide, then it's no longer 100px wide). |
Just wanted to link this issue with #223 as both are related to some extent |
box-sizing: content-box
What problem does this solve or what need does it fill?
Could help in order to reproduce web default behaviour easily
What solution would you like?
Probably something as simple as passing an "BoxSizing" enum value to Style
What alternative(s) have you considered?
Made some tests but these were unfortunately inconclusive.
Additional context
If there is already a siimilar feature supported, then I am sorry, but I feel like I've done the research work through issues/ code
The text was updated successfully, but these errors were encountered: