As much as I love front-end development, the ecosystem can sometimes inflict unnecessary pain. Given the front-end ecosystem relies on very few packages for a lot of modern development, when something changes and packages that rely on those don’t update: it’s a disaster.
One such issue is Autoprefixer.
You most likely arrived here searching Google for the error message: autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
I have encountered this issue twice in the last few months. The first was Bootstrap (the issue has since been fixed in Bootstrap 5.2). And the most recent is MDB UI Kit which is material design for Bootstrap.
Many of the solutions you will find to this problem will tell you to downgrade the Autoprefixer package to version 10.4.5. Either saving the exact version or adding a resolution entry into your
package.json. This is because the change was introduced in version 10.4.6 of Autoprefixer.
The issue itself is rather trivial. It’s a deprecated CSS shorthand property being used.
I didn’t want to downgrade Autoprefixer.
In my situation, I fixed the issue by forking the MDB UI Kit repository and submitting a pull request. If you’re a developer and you run into these kinds of issues, a PR to fix them would be welcomed by any active repository.
You can downgrade your package, but the best fix is to make the change to the package yourself in a fork on GitHub. While you wait for the maintainer to merge and release, you can tell Npm or Yarn to use your fork as the source to get around the warning.