Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the deprecated color-adjust with print-color-adjust #36283

Merged
merged 4 commits into from
May 24, 2022

Conversation

AdrianCurtin
Copy link

@AdrianCurtin AdrianCurtin commented May 5, 2022

https://developer.mozilla.org/en-US/docs/Web/CSS/print-color-adjust

This fixes issues with autoprefixer ^10.4.6
(https://github.com/postcss/autoprefixer/releases/tag/10.4.6)
Which throw warnings for use of color-adjust CSS

Fixes #36259

@AdrianCurtin AdrianCurtin requested a review from a team as a code owner May 5, 2022 18:59
@mdo
Copy link
Member

mdo commented May 5, 2022

There's no need to update the dist files, that happens on release. Can you revert those changes?

@AdrianCurtin
Copy link
Author

@mdo done

@mbrodala
Copy link
Contributor

mbrodala commented May 6, 2022

By now this is a duplicate of #36258 so it can be closed IMO.

(Not sure if a PR for 4.x is necessary or if a backport is possible though.)

@mdo
Copy link
Member

mdo commented May 6, 2022

By now this is a duplicate of #36258 so it can be closed IMO.

(Not sure if a PR for 4.x is necessary or if a backport is possible though.)

They're separate, so we'll leave both PRs.

@XhmikosR
Copy link
Member

@mdo: I'm not sure we can apply this in v4 due to our supported browsers.

@AdrianCurtin
Copy link
Author

AdrianCurtin commented May 20, 2022

@XhmikosR
If this is the case and you want to leave it in, you should use an older version of autoprefixer, otherwise the warning will be treated as an error in production

Also prevents automated deployments without finding workarounds to modify the installed version of autoprefixer

@XhmikosR
Copy link
Member

It's not an error, it's a warning. And we can't control the tools the consumers of the package use.

@AdrianCurtin
Copy link
Author

@XhmikosR , I guess that its not specifically an error, but because its somewhat common to enable "treat warnings as errors" it does affect a lot of automatic deployments. It's true that you can't control what tools other users use, but you can control which tools that you use. So if you want to update the prefixer in v5, but not in v4, that's another way to get around these warnings.

https://caniuse.com/?search=print-color-adjust

Currently the only web browsers which really used only color-adjust appear to have been earlier builds of firefox for which 48-97, during which print-color-adjust enjoyed partial support. Other browsers do not support color-adjust or require the webkit prefix.

So maintaining this to support old versions of firefox eschews support of that functionality in Edge, Chrome, Safari etc

@XhmikosR XhmikosR linked an issue May 24, 2022 that may be closed by this pull request
3 tasks
@XhmikosR XhmikosR changed the title Replace deprecated color-adjust with print-color-adjust Replace the deprecated color-adjust with print-color-adjust May 24, 2022
@XhmikosR XhmikosR merged commit 6a50084 into twbs:v4-dev May 24, 2022
@jrochkind
Copy link

jrochkind commented May 24, 2022

It's not an error, it's a warning. And we can't control the tools the consumers of the package use.

I am using bootstrap 4 via the ruby gem, which used to be a supported/recommended path to using bootstrap 4. The bootstrap 4 ruby gem has a dependency on autoprefixer-rails. So autoprefixer is not a tool I chose to use, it's in fact one bootstrap did control.

While my current setup doesn't cause any builds to fail, I now get this autoprefixer warning in all my build output -- written directly to stdout, in the middle of my build output. Which is a bit annoying.

I don't think I have a way to remove autoprefixer from my app, as it's a bootstrap dependency; I guess I could lock to an older version that doesn't produce this warning. And hope i don't lose anything else from future autoprefixers that I might need.

If anyone has any other ideas for eliminating this warning from my use of bootstrap 4 via ruby gem, I'd be interested in hearing them. I wish I had a way to configure autoprefixer to not output this warning, but I don't believe I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autoprefixer: Replace color-adjust to print-color-adjust.
10 participants