doomemacs / doomemacs/core

`rainbow-mode` highlights colors in places where it shouldn't (e.g. variable names)

Open
#6,557 3 comments 0 reactions 0 assignees View on GitHub
:lang web
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:
Screen Shot 2022-07-12 at 12 25 26 PM

### What actually happened?

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

Screen Shot 2022-07-12 at 11 35 45 AM

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.