diff --git a/edit/codemirror-default.js b/edit/codemirror-default.js index f2c2c452..e68d9f35 100644 --- a/edit/codemirror-default.js +++ b/edit/codemirror-default.js @@ -193,7 +193,8 @@ CodeMirror.hint && (() => { string[pos - 3] === ']' && string[pos - 4] === ']') { const vars = typeof editor !== 'undefined' && (editor.getStyle().usercssData || {}).vars; - if (vars && Object.hasOwnProperty.call(vars, string.slice(start + 4, pos - 4))) { + const name = vars && string.slice(start + 4, pos - 4); + if (vars && Object.hasOwnProperty.call(vars, name.endsWith('-rgb') ? name.slice(0, -4) : name)) { token[0] = USO_VALID_VAR; } else { token[0] = USO_INVALID_VAR;