CSS Grid Row Height Safari Bug

Short Answer The problem is that Safari is not recognizing the height: 100% on the img elements. Explanation This is not a Safari bug. It’s just a different interpretation of the spec. When dealing with percentage heights, some browsers (like Safari) adhere to the traditional interpretation of the spec, which requires a defined height on … Read more

Why doesn’t min-content work with auto-fill or auto-fit?

The second rule doesn’t work because min-content is an intrinsic sizing function. § 7.2.2.1. Syntax of repeat() Automatic repetitions (auto-fill or auto-fit) cannot be combined with intrinsic or flexible sizes. § 11. Grid Sizing An intrinsic sizing function (min-content, max-content, auto, fit-content()). A flexible sizing function [is a dimension with the fr unit].

Getting columns to wrap in CSS Grid

Neither HTML or CSS have any concept of when descendants of a container wrap. Essentially, the browser renders the document during an initial cascade. It does not reflow the document when a child wraps. Therefore, to change the number of columns, you will need to set a width limit somewhere along the line or use … Read more

minmax fails (invalid property value)

When using auto-fill or auto-fit, there must be a definite min-size or max-size. By “definite”, the spec means: A size that can be determined without measuring content. https://www.w3.org/TR/css-sizing-3/#definite When you set both minmax arguments to content-based size, like this: grid-template-columns: repeat(auto-fill, minmax(auto, 1fr)); … that’s a violation of the spec because there is no definite … Read more