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

Can/should we add a stylelint rule, forcing grid children to set a min-width #209

Open
peeke opened this issue Nov 12, 2020 · 1 comment
Labels

Comments

@peeke
Copy link
Contributor

peeke commented Nov 12, 2020

Is it possible to add a stylelint rule, that forces grid children to define min-width?

By default, a grid item cannot be smaller than the size of its content, since grid items have an initial size of min-width: auto and min-height: auto.

This can (and will, at some point) lead to grid blowouts. Setting the min-width: 0 effectively resets this minimum size to a less problematic value. The issue can also be fixed by using minmax(0, 1fr) instead of 1fr in your column definitions, but this would in my eyes be less develoepr friendly.

https://css-tricks.com/preventing-a-grid-blowout/

@peeke peeke added the question label Nov 12, 2020
@EECOLOR
Copy link
Member

EECOLOR commented Nov 12, 2020

I don't think we have that kind of requirement yet, but I'm pretty sure the checkRuleRelation function can handle it

You can check parent-child-policy for some examples the other way around.

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

No branches or pull requests

2 participants