debugger icon indicating copy to clipboard operation
debugger copied to clipboard

Use autoprefixer for vendor specific properties

Open irfanhudda opened this issue 9 years ago • 9 comments

We should use autoprefixer for generating vendor specific properties, pseudo elements.

There are many advantages to using autoprefixer like having less code to maintain and avoid duplication of css rules.

And it looks like we already have autoprefixer in our setup (according to yarn.lock file).

Any advice from people who have used autoprefixer?

irfanhudda avatar Jan 25 '17 15:01 irfanhudda

I'm in favor of this. It simplifies our css quite a bit.

already have autoprefixer in our setup

yarn pulls in a lot of things, you can check the file and see who pulls it in...

@clarkbw what do you think?

jasonLaster avatar Jan 25 '17 17:01 jasonLaster

stylelint and cssnano require it.

yarn why autoprefixer
yarn why autoprefixer
yarn why v0.19.1
[1/4] Why do we have the module "autoprefixer"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
info Reasons this module exists
   - "stylelint" depends on it
   - "devtools-launchpad#css-loader#cssnano" depends on it
info Disk size without dependencies: "376kB"
info Disk size with unique dependencies: "9.16MB"
info Disk size with transitive dependencies: "10.17MB"
info Amount of shared dependencies: 13
Done in 1.44s.

Garbee avatar Jan 25 '17 17:01 Garbee

@clarkbw what do you think?

👍 There is a plugin for PostCSS https://github.com/postcss/autoprefixer and it might be nice to have a version that strips everything but the moz extensions for the panel builds.

clarkbw avatar Jan 25 '17 18:01 clarkbw

We can swap configs on the moz builds pretty easily by just overriding it in the script that compiles the build. That tackle's the moz prefixes only for the internal stuff.

Garbee avatar Jan 25 '17 18:01 Garbee

@clarkbw my guess is that we'll add all the prefixes, which is okay too...

jasonLaster avatar Jan 25 '17 19:01 jasonLaster

my guess is that we'll add all the prefixes, which is okay too...

Only for the Firefox build. I know we get bugs filed about this often. The -webkit CSS prefix creates error logs in the browser console so if we could remove the unneeded prefixes we wouldn't see those bugs filed anymore.

Otherwise I think we'd always want the prefixes for a target set of browsers we want to work with.

clarkbw avatar Jan 25 '17 19:01 clarkbw

got it. This might be nice in an devtools-core bug where we strip out the bad prefixes when we publish.

https://github.com/devtools-html/devtools-core/issues/128

jasonLaster avatar Jan 25 '17 23:01 jasonLaster

ping @irfanhudda, @amitzur, @nchevobbe any interest in picking this up?

jasonLaster avatar Mar 06 '17 22:03 jasonLaster

I'll pick this up.

irfanhudda avatar Mar 07 '17 14:03 irfanhudda