Enable vendor prefix autocomplete in CSS files in Visual Studio Code

leemon picture leemon · Jun 19, 2018 · Viewed 9.2k times · Source

How can I tell VSCode to automatically add vendor prefixed style properties when adding a property without vendor prefixes added in CSS files (not SASS nor LESS files)?

Answer

Pinaki picture Pinaki · Oct 28, 2020

I have been using VS Code Autoprefixer plugin. It supports CSS, SCSS and SASS.

Select all CSS, then hit command pallet, then hit AutoPrefixer: Run.

If nothing happens, then add this below section in settings.json for Autoprefixer -

"autoprefixer.options": {
    "browsers": [
        "last 4 versions",
        "ie >= 9",
        "> 5%"
    ]
}

After that select all CSS, then hit command pallet, then hit AutoPrefixer: Run and it will work.