Skip to content

Commit

Permalink
Update color warnings to match other warnings (#5412)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
nifte and adamwathan committed Sep 10, 2021
1 parent 7859cee commit f332bee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions colors.js
Original file line number Diff line number Diff line change
@@ -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)
}
}
Expand Down

0 comments on commit f332bee

Please sign in to comment.