vscode中背景图插件:background的使用
2021年11月19日
850
vscode中背景图插件:background的使用


首先搜索并安装 background 插件

接着,打开文件 > 首选项 > 设置
搜索 background 找到插件设置,点击在 settings.json 中进行自定义设置

设置自己喜欢的图片作为背景
{
"background.enabled": true,
"background.useDefault": false,
"background.customImages": [
"file:///D:/vscodebg/1.jpg"
],
"background.style": {
"content": "''",
"pointer-events": "none",
"position": "absolute",
"z-index": "99999",
"width": "100%",
"height": "100%",
"background-position": "center",
"background-repeat": "no-repeat",
"background-size": "100%,100%",
"opacity": 0.1
},
"editor.formatOnSave": true,
"workbench.colorTheme": "Visual Studio Dark",
"editor.fontSize": 23,
"liveServer.settings.CustomBrowser": "chrome",
"px-to-rem.px-per-rem": 100,
"cssrem.rootFontSize": 100,
"files.autoSave": "afterDelay"
}预览

第一句"background.enabled": true,是插件是否启用,当我们把插件下载下来并且重启vscode之后,就已经有了这句话
第二句"background.useDefault": false,是否使用默认图片,改成false,不默认,我们要设置自己想要的!
第三句 设置路径,细心的道友已经注意到了,这是一个数组,也就是说可以设置多张不同的图片!记住,最多三张! /D:/like.jpg 是图片的路径地址
"background.customImages": [
"file:///D:/vscodebg/1.jpg"
],
最后就是background.style样式了,注意后面的"opacity": 0.1透明度是可以设置的。
