A
A
Andrej Sharapov2018-10-04 11:00:52
css
Andrej Sharapov, 2018-10-04 11:00:52

Why does the autoprefixer add a prefix for box-shadow?

Good afternoon!
Tell me, why, when executing the gulp command, does the autoprefixer add -webkit- for box-shadow, if Can I Use says that it is supported by all browsers? Should I use prefixes, relying on it or remove it? It also depends on the size of the file.
And another question, which is better to use: vscode plugins or a package for gallp? for the same autoprefixer and csscomb

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Pautov, 2018-10-04
@Madeas

The autoprefixer works based on a setting in webpack or gulp that specifies which browser versions you support. And he needs can i use in order to find out if it is necessary to specify a prefix to the properties for the specified version of the browser. Either put the bolt down, because there's nothing wrong with that, or just provide a list of browser versions that don't need prefixes.
Answering the 2nd question, it is better to use plugins for gallp or webpack. The reason is simple, your build template will work independently of any editor and anyone can easily use all the features of your build by running the 1st npm install command, and you can change the editor in which you will re-install your plugins.

M
Maxim Timofeev, 2018-10-04
@webinar

if it says Can I Use

Does the developer of your autoprefixer say that his script takes information from caniuse? They live separately, not synchronized. These are two different projects, so differences in information are normal and expected.
Which of the two? How do prefixes interfere with you, especially since we are talking about only one css property? Are you worried that there will be an extra 40 bytes of css weight? I think optimizing the css code and selectors will give more.
The absence of a prefix can be critical for layout, an extra prefix is ​​just an extra weight of the css file and nothing more. I don't see a problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question