-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Lighthouse 'Avoids old CSS flexbox' audit fails #1658
Comments
We'll be enabling support for specifying the browser list in |
Ah, good to know. :) Specifying browserslist partially fixes the issue, but the autoprefixer option For anyone else with this issue, I managed to pass the audit with the following autoprefixer options (with inspiration from GoogleChrome/lighthouse#1710 (comment)):
|
@gaearon Please consider adding postcss-flexbugs-fixes
Being able to add the browser support of Bootstrap 4 to my project would be very helpful: |
So how did you specify it? I’m not sure I understand this comment.
How do we know it is safe? It doesn't look like a very popular project.
What is your use case in particular? Are you trying to reduce how many rules are generated (original motivation of this thread)? Or something else? |
Bootstrap 4 have been successfully using postcss-flexbugs-fixes for quite a while in their build process to compile SASS to CSS. See here
Being able to customize the Bootstrap 4 SASS and then compile the SASS files to same browser support requirements as Bootstrap 4 |
Interesting. Would you like to send a PR to us to enable this plugin?
Compile which Sass files? Your app's? Are you using this method or some other way of using Sass in Create React App? Why is it important for app files to match Bootstrap's targeted versions, rather than browsers of your users? I'm a bit confused by this. |
Yes
Bootstrap 4 SASS along with my app's SASS files
Yes I am using CRA's method
My project is based on Bootstrap 4 and because I am compiling Bootstrap's SASS along with my app's SASS files I need to match Bootstrap's targeted browser versions. For example, Bootstrap 4 now only supports IE >= 10 so it makes no sense to have IE9 CSS code in my app if Bootstrap 4 doesn't support it. |
OK, this makes sense. Happy to review a PR that enables the flexbox bug plugin. I’d also be happy to review a PR that provides If you need any help let me know. |
Yes, I need help please. Thank you |
Is there anything in particular I can help you with? You'll probably want to edit Webpack configs in |
I'll give it a go |
Fixed by #1771. |
Please help beta test the new version that includes this change! |
Can you reproduce the problem with latest npm?
Yes.
Description
The current autoprefixer options prefixes flexbox with old CSS rules, which fails the following Lighthouse audit:
https://developers.google.com/web/tools/lighthouse/audits/old-flexbox
Expected behavior
Lighthouse audit 'Avoids old CSS flexbox' should pass.
Actual behavior
Lighthouse 'Avoids old CSS flexbox' audit fails.
Expanding 'More information' in the audit reveals that autoprefixer has added
display: -webkit-box;
anddisplay: -ms-flexbox;
to the compiled CSS.Reproducible Demo
create-react-app my-app && cd my-app
display: flex;
tobody
selector insrc/index.css
.npm start
ornpm run build
and open local page in browser.The text was updated successfully, but these errors were encountered: