简体   繁体   中英

how to define editor.selectionBackground in Visual Studio Code based on theme?

in my settings.json I have the following.

  "workbench.colorCustomizations": {
    "editor.selectionBackground": "#EBFF38",  //light theme
    "editor.selectionHighlightBackground": "#AEFF95",  //light theme
    //"editorBracketMatch.background": "#ff0000",  //dark theme
    //"editorBracketMatch.border": "#ff00ff",      //dark theme
  },

every night I need to comment the first 2 lines at the top

every morning I need to comment the first 2 lines at the bottom

is there any way to do this automatically? when selecting the theme ?

please advise, thank you

"workbench.colorCustomizations": {
    "[your light theme name]": {
       "editor.selectionBackground": "#EBFF38",  //light theme
       "editor.selectionHighlightBackground": "#AEFF95",  //light theme
    },
    "[your dark theme name]": {
       "editorBracketMatch.background": "#ff0000",  //dark theme
       "editorBracketMatch.border": "#ff00ff",      //dark theme
    },
    [rest of your colorCustomizations]
}

See vscode docs: customizing a color theme .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM