Sublime-JS-Custom icon indicating copy to clipboard operation
Sublime-JS-Custom copied to clipboard

Styled Components highlighting bug

Open felixcatto opened this issue 1 year ago • 9 comments

Sublime Text build number

4150

Example Code

const myClass = css`
  display: block;
`;

JS Custom Preferences

{
  "configurations": {
    "TSX + CSS": {
      "scope": "source.tsx",
      "file_extensions": ["tsx"],
      "typescript": true,
      "jsx": true,
      "custom_templates": {
        "styled_components": true,
        "tags": {
          "css": "scope:source.css"
        }
      }
    }
  }
}

Configuration name

No response

Description

Currently with those config it works, but it applies original source.css scope inside template string. I.e. syntax only works inside css class. But in styled components there is no need to write css class. It should work on top level, without css selectors.

2023-07-01_08-43

2023-07-01_08-44

2023-07-01_08-46

2023-07-01_08-46_1

I tried to add more specific scope

"tags": {
  "css": "scope:source.css meta.property-list.css meta.block.css"
}

But this doesn't work, the result scope is text.plain :cry:

felixcatto avatar Jul 01 '23 04:07 felixcatto