Skip to content

css syntax coloring doesn't work properly with css custom media #45

Open

Description

CSS files using custom media queries (e.g. @media (--desktop-down) {..}) have incorrect syntax highlighting (see attached image)

Does this issue occur when all extensions are disabled?: Yes

It occurs in vscode insiders too

  • VS Code Version: 1.103.0
  • OS Version: OSX 15

Steps to Reproduce:

  1. Create a css file using custom media syntax
Image

Activity

  1. removed their assignment
    on Aug 13, 2025
  2. romainmenke commented on Aug 13, 2025

    @romainmenke
    Contributor

    This is because of the nested CSS and is unrelated to the custom media.
    This can be closed in favor of: #9

    Massimo Cassandro (@massimo-cassandro) Can you also provide code and not only a screenshot in the future?
    A screenshot can't be copy/pasted.


    @media (color) {
    	body {
    		color: red;
    	}
    }
    
    body {
    	@media (color) {
    		color: red;
    	}
    }
    Image
  3. massimo-cassandro commented on Aug 18, 2025

    @massimo-cassandro
    Author

    Installing the extension suggested in #9 seems to solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions