kode-team / codemirror-colorpicker

colorpicker with codemirror
https://colorpicker.easylogic.studio/
MIT License
137 stars 13 forks source link

Scss variable name triggers color picker #46

Closed jwheatp closed 2 years ago

jwheatp commented 2 years ago

First, thank you for your great work.

Describe the bug When using CodeMirror in Scss mode with variables, this happen if you choose a color name as variable name :

image

Seems we need to add to the exluded token the "variable" token. https://github.com/easylogic/codemirror-colorpicker/blob/main/src/extension/codemirror/colorview.js#L7

image

Is it enough ? :)

easylogic commented 2 years ago

hi @jwheatp

Thanks for your reporting.

I will check it.

can you tell me codemirror mode ? (scss?)

jwheatp commented 2 years ago

The mode is "text/x-scss"

require("codemirror/mode/css/css.js");

CodeMirror(this.$refs.editor, {
      value: this.code,
      mode: "text/x-scss",
      theme: "ambiance",
      colorpicker : {
          mode : 'edit',
          type : 'vscode'
      },
    });
easylogic commented 2 years ago

@jwheatp

I released new version (codemirror-colorpicker@1.9.73)

Please test it .

Thank you.

jwheatp commented 2 years ago

it works great, thanks for your quick fix @easylogic !