AutopReFixer:将颜色调整替换为打印色调。颜色调整速记目前已弃用

发布于 2025-02-04 11:03:22 字数 703 浏览 6 评论 0原文

我安装了autoprefixer,然后得到此警告:

npm install [email protected] --save-exact

警告./node_modules/bootstrap/dist/css/bootstrap.min.css
(./ node_modules/css-loader/dist/dist/cjs.js ?? ruleset [1] .rules [1] .Oneof [5] .Use [1]! 。 Bootstrap.min.css)
模块警告(来自./node_modules/postcss-loader/dist/cjs.js):
警告

autoprefixer:将颜色调整替换为打印色调。颜色调整速记目前已弃用。

WebPack用1个警告

编译

I installed autoprefixer and I get this warning:

npm install [email protected] --save-exact

WARNING in ./node_modules/bootstrap/dist/css/bootstrap.min.css
(./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./node_modules/bootstrap/dist/css/bootstrap.min.css)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning

autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.

webpack compiled with 1 warning

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

原来分手还会想你 2025-02-11 11:03:23

此问题是因为 autoprefixer v10.4.6 + color-udjust rebecrecation ,它被print> print> print> print-color-udjust 。它目前由 bootstrap v5.2.0-beta1 固定。因此,您可以更新 bootstrap 版本:

npm i [email protected]

或者,只需覆盖 autoprefixer 插件和 downgrade it it it it /em>:

  1. 在您的React应用程序的 package.json 中,在依赖项之后添加以下部分:{...}
"overrides": {
    "autoprefixer": "10.4.5"
 }
  1. 运行命令npm安装

  2. ,最后npm start

This issue is because of Autoprefixer v10.4.6+ color-adjust deprecation and it's replaced with print-color-adjust. It's currently fixed by Bootstrap v5.2.0-beta1. So you can update your Bootstrap version:

npm i [email protected]

Or, just override Autoprefixer plugin and downgrade it to previous version "10.4.5":

  1. In package.json of your react app, add the following section after the dependencies: {...}
"overrides": {
    "autoprefixer": "10.4.5"
 }
  1. Run the command npm install

  2. And finally npm start

你是年少的欢喜 2025-02-11 11:03:23

我遇到了这个错误,但与Bootstrap无关。与Next.js / tailwind CSS有关。

我遇到了这个错误:

warn  - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[2]!./src/styles/globals.css
Warning
(1:1) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[2]!./src/styles/globals.css

作为 next.js tailwind安装,TailWind建议使用<<代码> POSTCSS 和AutoPrefixer

我已经更新了PostCSSautoprefixer npm软件包,但我仍然遇到此错误。

为了修复它,我需要更新所有尾风插件。

这是如何升级尾管CSS插件整个尾风安装:

npm install --save-dev tailwindcss@latest \
  @tailwindcss/typography@latest \
  @tailwindcss/forms@latest \
  @tailwindcss/aspect-ratio@latest \
  @tailwindcss/line-clamp@latest \
  postcss@latest \
  autoprefixer@latest

I came across this error but unrelated to Bootstrap. It was with Next.js / Tailwind CSS.

I was getting this error:

warn  - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[2]!./src/styles/globals.css
Warning
(1:1) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[2]!./src/styles/globals.css

As part of the Next.js tailwind installation, tailwind suggests installing with postcss and autoprefixer.

I had updated the postcss and autoprefixer npm packages, but I was still getting this error.

To fix it I needed to update all of the tailwind plugins.

Here is an example of how to upgrade the tailwind css plugins, this is doing the whole tailwind installation:

npm install --save-dev tailwindcss@latest \
  @tailwindcss/typography@latest \
  @tailwindcss/forms@latest \
  @tailwindcss/aspect-ratio@latest \
  @tailwindcss/line-clamp@latest \
  postcss@latest \
  autoprefixer@latest
眼泪也成诗 2025-02-11 11:03:23

Upgrade bootstrap to 5.2.0-beta1 by running the following command:

npm install [email protected]

Source: https: //github.com/twbs/bootstrap/issues/36259#issuecomment-1143073964

Upgrade bootstrap to 5.2.0-beta1 by running the following command:

npm install [email protected]

Source: https://github.com/twbs/bootstrap/issues/36259#issuecomment-1143073964

指尖凝香 2025-02-11 11:03:23

对于rush.js用户,您需要将它们添加到common/config/config/rush/common-versions.json

  "preferredVersions": {
    "autoprefixer": "10.4.5",
    "postcss-preset-env": "7.4.3"
  },

因为最新版本的Postcss-preset-envreact-scripts又需要:“ 5.0.0”)需要“ autoprefixer”:“ 10.4.5”

For Rush.js users, you'll want to add these to your common/config/rush/common-versions.json:

  "preferredVersions": {
    "autoprefixer": "10.4.5",
    "postcss-preset-env": "7.4.3"
  },

because the latest version of postcss-preset-env (which is in turn required by react-scripts: "5.0.0") requires "autoprefixer": "10.4.5"

旧时模样 2025-02-11 11:03:23

您可以做到这一点:

yarn add [email protected]

它对我有用。

You can do this:

yarn add [email protected]

It worked for me.

得不到的就毁灭 2025-02-11 11:03:23

我认为这个错误是由于引导程序和尾风的存在。

我只是删除引导程序,并且错误消失了。

I think this error is because of the existence of both bootstrap and tailwind.

I just remove bootstrap, and the error disappears.

你好,陌生人 2025-02-11 11:03:23

我的解决方案是下一个,但我使用的不是bootstrap,也许有人有我的问题:

npm install tailwindcss@latest postcss@latest autoprefixer@latest @tailwindcss/forms@latest

My solution was the next but i use Tailwind not Bootstrap, maybe someone have my same issue:

npm install tailwindcss@latest postcss@latest autoprefixer@latest @tailwindcss/forms@latest
日暮斜阳 2025-02-11 11:03:23

npm install

npm install [email protected] worked for me

泼猴你往哪里跑 2025-02-11 11:03:23

如果您不需要触摸软件包的解决方案。JSON或升级/降级自动FREFIXER,或删除Bootstrap,请按照以下步骤操作:

  1. 搜索vs code in voly-unjust,
  2. 它将在您的 .css文件中找到它, /em>(不在节点模块文件夹中
  3. 用打印色调替换它,并保存所有更改的文件

示例:

before:

-webkit-print-color-adjust: exact;
color-adjust: exact;

after:
-webkit-print-color-adjust: exact;
print-color-adjust: exact;

If you need a solution with no need to touch the package.json or upgrade/downgrade autoprefixer , or remove bootstrap follow the steps:

  1. search in vs code for color-adjust
  2. it will find it in yours .css files you wrote (not in node modules folder)
  3. replace it with print-color-adjust and save all the changed files

example :

before:

-webkit-print-color-adjust: exact;
color-adjust: exact;

after:
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
剑心龙吟 2025-02-11 11:03:23

转到./ node_modules/bootstrap/dist/dist/css/bootstrap.min.css,然后将color-udjust替换为print-color-udjust,然后在此处输入代码并在此处输入代码
npm install 这对我有用

Go to ./node_modules/bootstrap/dist/css/bootstrap.min.css and Replace color-adjust to print-color-adjust and enter code here and type
npm install [email protected] --save-exact This worked for me

放我走吧 2025-02-11 11:03:23

转到\ node_modules \ bootstrap \ dist \ css \ bootstrap.css,通常在第2482行中,编辑

颜色调整:精确;

print-color-unjust:cract;

go to \node_modules\bootstrap\dist\css\bootstrap.css, usually in the line 2482, edit

color-adjust: exact;

to

print-color-adjust: exact;

信愁 2025-02-11 11:03:22

package.json中添加以下行:

如果您使用的是 Yarn

"resolutions": {
    "autoprefixer": "10.4.5"
}

如果您正在使用 npm

"overrides": {
    "autoprefixer": "10.4.5"
}

Add following line in package.json:

If you're using yarn:

"resolutions": {
    "autoprefixer": "10.4.5"
}

If you're using npm:

"overrides": {
    "autoprefixer": "10.4.5"
}
过度放纵 2025-02-11 11:03:22

解决方案是使用命令安装Bootstrap 5.2 beta

npm install [email protected]

The solution was to install bootstrap 5.2 beta using the command

npm install [email protected]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文