Autoprefixer

This topic contains 1 reply, has 2 voices, and was last updated by  Sebastian 2 weeks, 6 days ago.

Author Posts

ddenev

Dear Sebastian,

Currently, when using the normal CSS editing options, the vendor prefixes are added automatically and this is great. The thing is that when using SCSS, vendor prefixes are not auto added and we have to add them manually (or via mixins).

Do you think it might be a good idea to incorporate an autoprefixer to take care of all vendor prefix stuff – https://github.com/postcss/autoprefixer?

And since this works as a post-processor for CSS it might also take care of the vendor prefixes even when not using SCSS in MT (I guess you apply them yourself in the code in this case).

Best regards,
Drago


Sebastian

Hi Drago,

You are right to point this out. The reasons this doesn’t happen automatically with Sass enabled may not be applicable for much longer.

Previously Sass was compiled on the server, where as vanilla CSS is formatted and rendered with JavaScript. This meant that the functionality had to be forked. Some things that were possible with vanilla CSS could not be easily carried over to Sass. Like adding prefixes. MT does this by parsing the CSS into property/value JS objects that can be easily manipulated. Until recently, MT wasn’t parsing Sass. It was just sending it to the sever to be converted to CSS. But the current beta does parse Sass, and renders it instantly. Now the two features can be merged. This means:

  1. Properties can be prefixed with Sass
  2. The code editor and UI fields can be used interchangeably even with Sass
  3. Sass files can be imported via Packs > Import > CSS stylesheet

There may still be a case for using postCSS and the autoprefixer plugin. I will check how lightweight it is.

These improvements to Sass support will have to wait a while though. I’m currently working on CSS grid and transform properties 🙂

Cheers,
Sebastian

You must login or register to reply to this topic.