Sp-dev-docs: Autoprefixer and Browserslist is outdate and CSS Grid support missing

Created on 20 May 2019  路  5Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Autoprefixer should only support actually supported browser and fallback CSS grid layout syntax.

Observed Behavior

In the following file the CSS autoprefixer browser support is defined:
/node_modules/@microsoft/gulp-core-build-sass/lib/SassTask.js

Screenshot 2019-05-20 at 21 49 36

This definition means that from a CSS side of things even IE10 would be supported.
https://browserl.ist/?q=%3E+1%25%2Clast+2+versions%2Cie+%3E%3D+10

Which is as I know not the case anymore a better option would be to use the following browser support definition:

"> 1%","last 2 versions","ie > 11","not dead"

In addition, CSS grid is already supported in IE11 (with vendor-specific prefixes).
https://caniuse.com/#feat=css-grid

To support this in SPFx an additional setting is required so the overall configuration should look like this. So the overall configuration should look like this:

{
  grid: true,
  browsers: ["> 1%","last 2 versions","ie > 11","not dead"]
}

The current version used as the autoprefixer is "~9.1.3". This is the first version for CSS Grid included according to my research.
https://css-tricks.com/css-grid-in-ie-duplicate-area-names-now-supported/#article-header-id-11

tooling fixed fixed-next-drop tracked

Most helpful comment

@StfBauer this PR merged yesterday should allow the configuration of autoprefixer - https://github.com/microsoft/rushstack/pull/1891. We also updated the associated dependencies. You can override the SASS build task configuration using replaceConfigor similar API.

@microsoft/[email protected] has the change: https://www.npmjs.com/package/@microsoft/gulp-core-build-sass/v/4.11.0

cc: @andrewconnell @lucabandMSFT

All 5 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@StfBauer this PR merged yesterday should allow the configuration of autoprefixer - https://github.com/microsoft/rushstack/pull/1891. We also updated the associated dependencies. You can override the SASS build task configuration using replaceConfigor similar API.

@microsoft/[email protected] has the change: https://www.npmjs.com/package/@microsoft/gulp-core-build-sass/v/4.11.0

cc: @andrewconnell @lucabandMSFT

Tagging as fixed next drop as it will assume to take effect in SPFx v1.11...

Tagging as fixed next drop as it will assume to take effect in SPFx v1.11...

Yes, it should be included cc: @lucabandMSFT @johnguy0. We see significant savings by eliminating outdated vendor prefixes and want the community to benefit also.

@KevinTCoughlin so I can configure everything in package.json or via config file?

Was this page helpful?
0 / 5 - 0 ratings