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

minmax, but not wider than parent container #132

Open
mhchem opened this issue Apr 20, 2018 · 0 comments
Open

minmax, but not wider than parent container #132

mhchem opened this issue Apr 20, 2018 · 0 comments

Comments

@mhchem
Copy link

mhchem commented Apr 20, 2018

The CSS

grid-template-columns: repeat(auto-fill, minmax(30rem, 1fr));

works really great unless the parent container gets smaller than 30rem.

You can test here, by resizing the viewport with https://codepen.io/anon/pen/LmEyer

Basically, I am searching for something like

grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));

or maybe

grid-template-columns: repeat(auto-fill, min-preferredmin-max(100%, 30rem, 1fr));

Meaning: Use a min of 30rem, but never exceed the parent's width.

Can this be achieved at all? How?

(Disclaimer: I also asked at https://stackoverflow.com/q/49919572/8772169 with to answer yet except for media queries that do not work when the parent is not 100% of the viewport)

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

1 participant