Merge pull request #2137 from tailwindlabs/rename-gap-utilities

Deprecate col-gap and row-gap in favor of gap-x and gap-y
This commit is contained in:
Adam Wathan 2020-08-07 11:16:56 -04:00 • committed by GitHub
commit 3aa0a1bcbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 3061 additions and 200 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -58,9 +58,8 @@ it('generates the right CSS when enabling flagged features', () => {
return postcss([
tailwind({
experimental: {
uniformColorPalette: true,
},
future: 'all',
experimental: 'all',
}),
])
.process(input, { from: inputPath })

View file

@ -2,7 +2,7 @@ import _ from 'lodash'
import chalk from 'chalk'
const featureFlags = {
future: [],
future: ['removeDeprecatedGapUtilities'],
experimental: ['uniformColorPalette'],
}
@ -93,6 +93,7 @@ export function issueFlagNotices(config) {
log.risk(
'We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future.'
)
log.risk('https://tailwindcss.com/docs/upcoming-changes')
}
}

View file

@ -1,15 +1,26 @@
import createUtilityPlugin from '../util/createUtilityPlugin'
import { flagEnabled } from '../featureFlags'
export default function() {
return function({ target, ...args }) {
return function({ target, config, ...args }) {
if (target('gap') === 'ie11') {
return
}
createUtilityPlugin('gap', [
['gap', ['gridGap', 'gap']],
['col-gap', ['gridColumnGap', 'columnGap']],
['row-gap', ['gridRowGap', 'rowGap']],
])({ target, ...args })
if (flagEnabled(config(), 'removeDeprecatedGapUtilities')) {
createUtilityPlugin('gap', [
['gap', ['gridGap', 'gap']],
['gap-x', ['gridColumnGap', 'columnGap']],
['gap-y', ['gridRowGap', 'rowGap']],
])({ target, config, ...args })
} else {
createUtilityPlugin('gap', [
['gap', ['gridGap', 'gap']],
['col-gap', ['gridColumnGap', 'columnGap']],
['gap-x', ['gridColumnGap', 'columnGap']],
['row-gap', ['gridRowGap', 'rowGap']],
['gap-y', ['gridRowGap', 'rowGap']],
])({ target, config, ...args })
}
}
}