Deprecate col-gap and row-gap in favor of gap-x and gap-y #2137
+3,061
−200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR renames the
col-gap
androw-gap
utilities togap-x
andgap-y
accordingly. I don't know what possessed me to ever name themcol-gap
androw-gap
because it's inconsistent with how other things in Tailwind are named, and it trips me up constantly. Isrow-gap
the gaps in a row, or the gaps between rows? Always gets me.The new names feel more natural when using gap with Flexbox too (even though Flexbox does still use
column-gap
androw-gap
as the CSS property names) because Flexbox doesn't really have rows and columns.Shorter too 🤷
This PR introduces the new names alongside the old names (so increasing the CSS size a little bit), and adds the ability to remove the old names behind a
removeDeprecatedGapUtilities
flag under thefuture
key.You can opt-in to removing the old names like this:
The console will emit a warning for anyone who doesn't opt-in to this after they upgrade, which should help nudge people to make this change in preparation for Tailwind 2.0.
Before I merge this I'll need to make sure I create a documentation page for this flagging stuff so that we can put a link in the console warning directing people to a place where they can learn more about the warning and the consequences of making the change.