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

not getting display: -webkit-flex with any options #734

Closed
terion-name opened this issue Oct 15, 2016 · 9 comments
Closed

not getting display: -webkit-flex with any options #734

terion-name opened this issue Oct 15, 2016 · 9 comments

Comments

@terion-name
Copy link

terion-name commented Oct 15, 2016

Safari 8 needs display: -webkit-flex.
With any options I pass — I on't get it. Even with such hardcore as:

gulp.task('cssOwn:build', () => {
  return gulp.src(path.src.css) // css: 'src/css/styles.scss',
    .pipe(sass({
      includePaths: [path.dist.css],
      errLogToConsole: true
    }))
    .pipe(sass().on('error', sass.logError))
    .pipe(prefixer({
      browser: ['last 10 versions']
    }))
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest(path.dist.css))
    .pipe(connect.reload())
});

This results in:

ol.o-list {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-flow: column;
      flex-flow: column;
  -webkit-box-align: stretch;
      -ms-flex-align: stretch;
          align-items: stretch;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between; }

It sets display: -webkit-box; for Safari 6, but not display: -webkit-flex for Safari 8

@ai
Copy link
Member

ai commented Oct 15, 2016

Everything works in online demo.

You have a problem somewhere in environment.

I think it is related to this question (you should move browsers to browserslist config):
https://github.com/postcss/autoprefixer#no-prefixes-in-production

@ai ai closed this as completed Oct 15, 2016
@terion-name
Copy link
Author

@ai ooh. this is just insane. I've tried to solve this for about a week, and just now understood, that there was a typo in config. what a shame. sorry for bothering

@fervillz
Copy link

fervillz commented Nov 8, 2016

@terion-name, having the same problem, what is your type problem, can you share?

@terion-name
Copy link
Author

@farcaller browser → browsers

@ai ai reopened this Nov 9, 2016
@ai
Copy link
Member

ai commented Nov 9, 2016

I will add warning for this case

@ai
Copy link
Member

ai commented Nov 10, 2016

Added 90a1454

@ai ai closed this as completed Nov 10, 2016
@terion-name
Copy link
Author

@ai thanx!

@rouberg
Copy link

rouberg commented Nov 16, 2018

optimize-css-assets-webpack-plugin use cssnano as default processor, and cssnano removed all prefix, so autoprefixer seemed not work in production.
we can config like this:

new OptimizeCssAssetsPlugin({
    cssProcessorOptions: {
      safe: true,
      autoprefixer: { disable: true },
      discardComments: {
        removeAll: true
      }
    }
  });

the option of autoprefixer: { disable: true } will disable cssnano's autoprefixer and saved prefixer that already exist by ourselves.

also see the issue optimize-css-assets-webpack-plugin/issues/51

maybe some brother need this so I copy and attach this although this issue closed a long time ago.

@ai
Copy link
Member

ai commented Nov 16, 2018

@rouberg there is better way. Always put browsers to .browserslistrc config (as we recommend). If you use browsers option, cssnano’s Autoprefixer (Babel and many other tools) will have different browsers. If you use Browserslist config, all your tools will have the same target browsers.

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

4 participants