Update color warnings to match other warnings (#5412)

* Update color warnings to match other warnings

Make the color deprecation warnings match the style of other warnings in tailwind

* Fix formatting

* Use log helper

Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
This commit is contained in:
Michael 2021-09-10 11:41:19 -07:00 committed by GitHub
parent 7859cee257
commit f332bee41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,13 @@
const log = require('./lib/util/log').default
let warned = []
function warn({ version, from, to }) {
if (!warned.includes(from)) {
console.log(`warn - As of Tailwind CSS ${version}, \`${from}\` has been renamed to \`${to}\`.`)
console.log('warn - Please update your color palette to eliminate this warning.')
log.warn([
`As of Tailwind CSS ${version}, \`${from}\` has been renamed to \`${to}\`.`,
'Please update your color palette to eliminate this warning.',
])
warned.push(from)
}
}