Skip to content
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

Firefox, Edge don’t stretch fit-content() tracks by default #9

Closed
simevidas opened this issue Aug 11, 2017 · 4 comments
Closed

Firefox, Edge don’t stretch fit-content() tracks by default #9

simevidas opened this issue Aug 11, 2017 · 4 comments

Comments

@simevidas
Copy link

Code:

.grid {
    display: grid;
    grid-template-columns: repeat(3, fit-content(100px));
}

Demo: https://codepen.io/simevidas/pen/LjLJgo?editors=0100

I’ve noticed that in Firefox and Edge 16 (the upcoming version with full Grid support), when you have a bunch of columns clamped with fit-content(), the columns don’t stretch when there is more space available in the grid container. In Chrome, they do.

This isn’t a big problem, since, when I’m restricting the max size with fit-content(), I don’t want the tracks to extend beyond this size, so I can just set justify-content: start to disable stretching explicitly.

@rachelandrew
Copy link
Owner

I think Chrome is incorrect here, fit-content should be clamping to the size you have set (100px). Would you agree?

@simevidas
Copy link
Author

Actually, I agree. I don’t know why I assumed Chrome was right. If fit-content() could be stretched, the spec would say so, like is says for auto.

@rachelandrew
Copy link
Owner

I've logged it as a Chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=755994

I think Firefox has this one correct, WebKit is showing the same behaviour as Chrome. Anyway it is definitely an interop problem so I'll add it to the list.

@rachelandrew
Copy link
Owner

On the listing as #14

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants