3 ms·
> I think gap is where this is all headed in the long term. gap? Is this new? I've been waiting for years for CSS to finally support something like that. Alway
by paraph1n 5y ago
> I think gap is where this is all headed in the long term.
gap? Is this new? I've been waiting for years for CSS to finally support something like that. Always thought it was weird that I had to mess with margins (and last-child hacks) to get a proper gap between items in a container.
- btown 5y agoYep! https://developer.mozilla.org/en-US/docs/Web/CSS/gap https://developer.mozilla.org/en-US/docs/Web/CSS/gap https://caniuse.com/?search=gap https://caniuse.com/?search=gap
- seumars 5y agoIt's part of CSS grid so in a way it's new, but CSS grid well supported nowadays.
- petepete 5y agoIt's been made more general than just grid (it used to be called grid-gap) and works with flexbox too. I don't know if Safari supports it in flexbox yet and it's a pain to detect with @supports because Safari _does_ support gap but in a different context, but it works fine in Chrome and Firefox. Edit: just checked, Safari 14.1 added support for using gap with Flexbox.
- deleted 5y ago[deleted]