`rainbow-mode` highlights colors in places where it shouldn't (e.g. variable names)
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
### What did you expect to happen?
I expected CSS custom properties that have css color names to not have syntax highlighting like this:

### What actually happened?
There is incorrect syntax highlighting for CSS color names in custom properties in .css files when scss-mode is enabled:

### Describe your attempts to resolve the issue
- I tried disabling `scss-mode`.
`(disable-packages! scss-mode)`
- I tried setting `auto-mode-alist` for scss-mode and css-mode
```elisp
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode))
```
### Steps to reproduce
Open a `.css` file and add the following example code:
```css
.component {
--red-100: #FF4500;
--invalid-background-color: var(--red-100);
}
```
### System Information
https://pastebin.com/RBCAaFpZ
Contributor guide
Research direction
Reproduce the highlighting issue in a .css file with scss-mode enabled, using the provided custom-property example, then inspect the interaction between rainbow-mode and scss-mode. Done means CSS custom-property names such as --red-100 are not highlighted as colors, while actual color values remain highlighted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, emacs, emacs-lisp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100