在Visual Studio Code的CSS文件中启用供应商前缀自动完成功能

在Visual Studio Code的CSS文件中启用供应商前缀自动完成功能

问题描述:

在添加没有在CSS文件(不是SASS或LESS文件)中添加供应商前缀的属性时,如何告诉VSCode自动添加供应商前缀的样式属性?

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)?

我一直在使用 VS Code Autoprefixer插件 .它支持CSS,SCSS和SASS.

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

选择所有CSS,然后点击命令托盘,然后点击 AutoPrefixer:运行.

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

如果什么也没发生,请在 settings.json 中为Autoprefixer添加以下内容-

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

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

然后选择所有CSS,然后单击命令托盘,然后单击 AutoPrefixer:Run ,它将起作用.

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