-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-grid] gap should autoprefix to grid-gap #1274
Comments
Autoprefixer should detect caniuse data for the If the browser does not support If the browser supports If the browser supports |
Because Autoprefixer deals with vendor prefixes only. |
What harm does it do to include support for this? This is essentially a standardised vendor prefix. There isn't really much difference between this and something like Adding support for this makes the lives of developers and library authors easier and leads to less kilobytes being downloaded by users since autoprefixer can only apply it when it is needed. |
|
I guess a warning is better than nothing. It at least gives users direction in terms of what they should do for the best browser support. |
OK. If we found |
Yeah basically. If |
Just throwing in my two cents here, I'm surprised this is out of scope for autoprefixer but the complex IE11 grid polyfill stuff is fair game. Feels like that should definitely be moved to |
So for now we would write: Input CSS: /* autoprefixer grid: autoplace */
.my_grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 1rem;
gap: 1rem;
} which will transform into: .my_grid {
display: -ms-grid;
display: grid;
-ms-grid-columns: 1fr 1rem 1fr;
grid-template-columns: 1fr 1fr;
grid-gap: 1rem;
gap: 1rem;
} Which, at the end of the day, feels like prefixing. But anyway, it works for me. |
@fschoenfeldt if you are only using it for CSS grid it is maybe not worth writing the Also, if you are going to add both manually, you should write the outdated one above the newer one so that the newer one takes priority in the browsers that support it. The way you wrote it, all browsers that support grid will use |
VSCode hints me that usage of
Good advice! I'll update my comment in case anyone wants to use this snippet. |
In reference to this comment in the tailwind grid support pull request:
tailwindlabs/tailwindcss#1274 (comment)
I think autoprefixer should translate
gap
togrid-gap
.Note that this should happen even if the grid prefixing setting is set to
false
since this is not an IE Grid compatibility issue. It is a modern CSS Grid issue.Input CSS:
Expected output:
Current output:
grid-gap
is essentially just a prefixed version ofgap
now, so I'm not sure why Autoprefixer wouldn't support it.The text was updated successfully, but these errors were encountered: