Is it possible to detect when flex gap is not supported by the browser?
I have many gap in my project, and most of the layout is made with flexbox. I noticed that many users have old browsers, and they not support flex gap. Is it possible to somehow detect when gap is not supported and add a fallback for this?
I know that there is solution with margins, but i would like to have gap instead of margin
I tried to use
@supports not ((gap: 1px) with (display: flex))
or
@supports not ((gap: 1px) and (display: flex))
but none of those works.
2
Answers
I found the solution with tailwind. In tailwind.config.cs i added
and then in my code i can just use
Not a pretty solution but works
Either make it not super important if the browser does not support it – as in too bad your display will not be excellent if you come with something as old as IE
OR use JS to test – this should work in IE11 at least