Skip to content

Commit

Permalink
Replace colorette with nanocolors
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 26, 2021
1 parent 889f18c commit b49f330
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
14 changes: 5 additions & 9 deletions lib/autoprefixer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let browserslist = require('browserslist')
let colorette = require('colorette')
let nanocolors = require('nanocolors')
let postcss = require('postcss')
let agents = require('caniuse-lite').agents

Expand Down Expand Up @@ -79,15 +79,11 @@ module.exports = postcss.plugin('autoprefixer', (...reqs) => {
reqs = options.overrideBrowserslist
} else if (options.browsers) {
if (typeof console !== 'undefined' && console.warn) {
if (colorette.red) {
console.warn(
colorette.red(
WARNING.replace(/`[^`]+`/g, i => colorette.yellow(i.slice(1, -1)))
)
console.warn(
nanocolors.red(
WARNING.replace(/`[^`]+`/g, i => nanocolors.yellow(i.slice(1, -1)))
)
} else {
console.warn(WARNING)
}
)
}
reqs = options.browsers
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@babel/register": "^7.10.5",
"browserslist": "^4.12.0",
"caniuse-lite": "^1.0.30001109",
"colorette": "^1.2.1",
"nanocolors": "^0.2.8",
"normalize-range": "^0.1.2",
"num2fraction": "^1.2.2",
"postcss": "^7.0.32",
Expand Down
11 changes: 0 additions & 11 deletions test/webpack.test.js

This file was deleted.

5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6908,6 +6908,11 @@ nan@^2.12.1:
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==

nanocolors@^0.2.8:
version "0.2.8"
resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.8.tgz#ea9190bb9a6834df3a53b2cf2dc52f5de76b84fd"
integrity sha512-lFtwopLYUwJ/w+VcBib+Ti1J+USzc/m2XN9LCCl/AhibkzYlXk6FHeqkJqBWRd70RpjArGWYZQjwa6UgwYycBA==

nanoid@^3.1.10:
version "3.1.10"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.10.tgz#69a8a52b77892de0d11cede96bc9762852145bc4"
Expand Down

0 comments on commit b49f330

Please sign in to comment.