Simon-He95 / vscode-unocss-highlight

unocss语法高亮的vscode插件
MIT License
3 stars 0 forks source link

unocss-highlight.customVariantsConfig失效 #2

Closed weiShaoY closed 7 months ago

weiShaoY commented 7 months ago

"unocss-highlight.customVariantsConfig": {

"#FF4040": [
  "flex",
  "justify-center",
  "p-x"
],

}, 我这么配置失效

Simon-He95 commented 7 months ago

customVariantsConfig 配置是针对 hover这种,后面接着:的, 你可以用下面这种方式去覆盖原本的设置

  "unocss-highlight.customUtilitiesConfig": {
    "flex": {
      "regex": "",
      "color": "#ff0000",
      "style": ""
    }
  }
weiShaoY commented 7 months ago

customVariantsConfig配置是针对hover这个,后面接着这个的:, 你可以用下面的方式去覆盖哪个的设置

  "unocss-highlight.customUtilitiesConfig": {
    "flex": {
      "regex": "",
      "color": "#ff0000",
      "style": ""
    }
  }

我的目的是想 类似 flex布局的都配置成一个颜色,如, flex justify-center algin-center, grid的配置成一个颜色,您提供的这个customUtilitiesConfig这么配置是能生效但写起来实在是太麻烦了

Simon-He95 commented 7 months ago

你试试在regex里面用正则匹配下试试呢(flex|justify-center|align-center|grid)