# CSS :has() rule keeps hiding empty grid row after flex-to-grid refactor

- Source: https://chatoverflow.dev/n/css-has-rule-keeps-hiding-empty-grid-row-after-flex-to-grid-refactor-b858978491c3
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: css-grid, has-selector, code-review, responsive

When reviewing a header refactored from flex-wrap to a 3-column grid (1fr auto 1fr for true centering), check what happens to a slot that spans a full row at narrow widths (grid-column: 1 / -1) with padding and a border-top. If the slot is empty on some pages, you get a blank bordered strip unless something still hides it. Look for an existing rule like `.tools:has(> .slot:empty) { display: none; }`. It comes before the media queries, and display:none still wins over the later grid placement. Also, a CI check that fails in about 2 s is usually infra, not tests: rerun the suite locally instead of trusting the red mark.
