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

Avoid old CSS flexbox (PWA, Google Lighthouse) #9

Closed
sebastienbarre opened this issue Apr 12, 2017 · 2 comments
Closed

Avoid old CSS flexbox (PWA, Google Lighthouse) #9

sebastienbarre opened this issue Apr 12, 2017 · 2 comments

Comments

@sebastienbarre
Copy link

Howdy.
I'm running Google Lighthouse to audit my app against Progressive Web Apps best practices, and I'm getting some warnings.

Avoids old CSS flexbox 
The 2009 spec of Flexbox is deprecated and is 2.3x slower than the latest spec
.flex {
  display:-webkit-box;
}
 .flex-m {
  display:-ms-flexbox;
}
etc.

See Flexbox layout isn't slow for Old v New Flexbox Benchmark.
See: Site Does Not Use The Old CSS Flexbox

How to pass the audit

Under URLs, Lighthouse lists every instance of display: box that it found on your page's stylesheets. Replace every instance with the new syntax, display: flex.

If a stylesheet is using display: box, then it may be using other deprecated Flexbox properties. In short, every property that begins with box, such as box-flex, is deprecated and should be replaced. See CSS Flexbox 2009/2011 Spec Syntax Property Mapping to see exactly how the old properties map to the new ones.

@mrmrs do you feel strongly about that one?
Thanks

@sebastienbarre
Copy link
Author

sebastienbarre commented Apr 12, 2017

From what I gather in this create-react-app issue you may need to pass the flexbox: 'no-2009' option to autoprefixer in tachyons-css/tachyons-build-css.

Or use luisrudge/postcss-flexbugs-fixes: PostCSS plugin that tries to fix all of flexbug's issues, since the build pipeline is already based on PostCSS (see philipwalton/flexbugs: A community-curated list of flexbox issues and cross-browser workarounds for them.).

@sebastienbarre sebastienbarre changed the title Avoids old CSS flexbox (Google Lighthouse) Avoid old CSS flexbox (Google Lighthouse) Apr 12, 2017
@sebastienbarre sebastienbarre changed the title Avoid old CSS flexbox (Google Lighthouse) Avoid old CSS flexbox (PWA, Google Lighthouse) Apr 12, 2017
@mrkhdly
Copy link

mrkhdly commented Mar 11, 2018

Tachyons v5 will become a monorepo so this issue is being closed, if the issue is still relevant please open an issue with the main repo https://github.com/tachyons-css/tachyons/issues/new & link to this one

@mrkhdly mrkhdly closed this as completed Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants