SVGs take up 100% of the a CSS-Grid cell (with gap:0px)
But (only in Firefox!) sometimes a white gap is displayed:

The unwanted 'gap' shows the Grid background. (there is a gap:0px on the Grid!)
Setting
shape-rendering:crispEdgesmakes it an even bigger gap.Setting a fixed integer Grid width (columns * N) pixels 'fixes' the unwanted gap
(but I can't use that, I have different Grid sizes, and use the available viewPort for the whole Grid)Setting a background color on all Grid cells, does not display that gap line.
An extra
<rect width='100%' wheight='100%' fill='blue'/>in each SVG does show extra more unwanted gaps.there is also an extra line/gap on the right hand side of the grid.
Does it require an SVG or CSS Grid fix?
Update 1
.. fine in Chrome.
In FireFox red background lines are displayed. 102% overflow 'fix' from answer is applied on mouseover. (but this does stretch the SVG vertically)
<style>
body {
--width: 177px; /* simulating responsive error lines */
--Xwidth: 180px; /* N x 10px 'fixes' the unwanted gaps */
--overflow: 100%; /* see suggested 'fix' below */
background: darkslategrey;
}
#Tiles {
width: var(--width);height: var(--width);
display: grid;
grid-template-columns: repeat(10, 1fr);
grid-template-rows: repeat(10, 1fr);
gap: 0px; background: red; /* should not be visible! */
box-sizing: border-box;
border: 2px solid yellow;
overflow:hidden;
}
#Tiles:hover{ --overflow: 102% }
svg { width: 100%;height: 100%; vertical-align: top }
/* "fix" still leaves one px line at the top. and stretches the SVG vertically */
svg {
width: var(--overflow);height: var(--overflow); overflow: visible;
margin-top: 0px; /* -1px to 'fix' top line */
}
</style>
<div id=Tiles></div>
<script>
Tiles.innerHTML = `<my-tile></my-tile>`.repeat(100);
customElements.define('my-tile', class extends HTMLElement {
connectedCallback() {
this.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">` +
`<rect width='100%' height='100%' fill='blue' /></svg>`;
}
});
</script>
Update 2
Resized the SO Snippet to smaller size... now Chrome goes wrong too
That leaves only one fix.. calculate cell-width and round to whole pixels...