-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CSS Grid #1865
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
base: main
Are you sure you want to change the base?
CSS Grid #1865
Conversation
|
@intergalacticspacehighway is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
c394ca6 to
69cf662
Compare
f5dc467 to
ded011f
Compare
74c932a to
3ad6a75
Compare
|
Oo, I haven't looked at the implementation yet, but I wanted to point you at https://github.com/DioxusLabs/taffy/tree/main/test_fixtures/grid where we have 250+ test cases for CSS Grid in almost the same format as Yoga's gentests (Taffy was originally a port/rewrite of Yoga to Rust, and it's test generation setup is very similar). There are a couple of slightly differences in the test format:
But the actual HTML snippets should be compatible, and you should be able to script a conversion fairly easily if you want to use them. |
|
Thanks @nicoburns. The tests were invaluable! There are a few tests which i haven't pushed which were failing because of some default styling in testsuite, looking into fixing those. And skipped some tests related to min-content/max-content sizing unit support as I kept it in later scope (which should be soon once the PR lands 😅). |
4e3e329 to
e3f4d36
Compare
Why?
How?
By extending Yoga to support CSS Grid spec. The implementation is open to suggestions, improvements, including anything I might have missed. Some work in progress items are listed below.
Current scope
Ensure the implementation follows CSS Grid Spec.
Properties
grid-template-columnsgrid-template-rowsgrid-column-startgrid-column-endgrid-row-startgrid-row-endgrid-auto-columnsgrid-auto-rowsSizing Functions/Units
minmax()autoPercentageFixed(pxunit)Flex(frunit)Future scope
grid-template-areasgrid-areamasonrygrid-auto-flowgrid-column/grid-rowshorthandsrepeat()auto-fill,auto-fit,fit-content,max-content,min-content)Spec differences
justify-contentis set to flex-start in yoga by default. We need to introduce normal keyword to match with the spec.normalbehaves asflex-startfor flexbox andstretchin grid.align-self,justify-self,justify-items,align-items. IntroducenormalkeywordNotes for reviewer
AutoPlacement.h,GridLayout.cppandTrackSizing.h. Apart from these, most of the files are data structures to hold grid styles and gentest files.