在Visual Studio Code的CSS文件中启用供应商前缀自动完成功能 [英] Enable vendor prefix autocomplete in CSS files in Visual Studio Code

查看:107
本文介绍了在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.

这篇关于在Visual Studio Code的CSS文件中启用供应商前缀自动完成功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆