Skip to content

Deprecate col-gap and row-gap in favor of gap-x and gap-y #2137

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

Merged
merged 3 commits into from
Aug 7, 2020

Conversation

adamwathan
Copy link
Member

This PR renames the col-gap and row-gap utilities to gap-x and gap-y accordingly. I don't know what possessed me to ever name them col-gap and row-gap because it's inconsistent with how other things in Tailwind are named, and it trips me up constantly. Is row-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 and row-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 the future key.

You can opt-in to removing the old names like this:

// tailwind.config.js
module.exports = {
  future: {
    removeDeprecatedGapUtilities: true,
  },
}

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.

@robertdrakedennis
Copy link

Would there also be a place for a class that performs both gap-x and gap-y? potentially gap-{number} to do both?

@adamwathan
Copy link
Member Author

Already exists! Has since we released grid support:

https://tailwindcss.com/docs/gap/#app

Just didn't need to rename that one.

@hacknug
Copy link
Contributor

hacknug commented Aug 7, 2020

YES PLEASE ADAM THANK YOU ❤️

@adamwathan adamwathan merged commit 3aa0a1b into master Aug 7, 2020
@adamwathan adamwathan deleted the rename-gap-utilities branch August 7, 2020 15:17
@jhonyjss
Copy link

Hello, I'm facing in my terminal a lot of this message:

info - You have opted-in to future-facing breaking changes: removeDeprecatedGapUtilities
info - These changes are stable and will be the default behavior in the next major version of Tailwind.

How Can I remove this ? ** I'm using nuxt.

@hacknug
Copy link
Contributor

hacknug commented Aug 19, 2020

How Can I remove this ? ** I'm using nuxt.

You need to opt-out of this behavior if I'm not mistaken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants