Sublime Forum

CSS syntax highlighting error with media queries

#1

It looks like Sublime Text (both 2 and 3) have an issue highlighting CSS media queries if the query is not all on one line.

For example,

@media only screen and (min-device-width: 600px) and (max-device-width : 1024px) { div#desktop { display: none; } }
highlights just fine while the following does not:

@media only screen and (min-device-width: 600px) and (max-device-width : 1024px) { div#desktop { display: none; } }

0 Likes

#2

The problem still exists. If the opening bracket is on the next line, the syntax highlighting does not work:


https://www.dropbox.com/s/xs9pth9cm5rsohh/Screenshot%202014-02-05%2013.32.16.png


https://www.dropbox.com/s/qh8vpm7c4y4bj7s/Screenshot%202014-02-05%2013.32.50.png

0 Likes

#3

check out a similar (the same?) issue on github:

https://github.com/MarioRicalde/SCSS.tmbundle/issues/145

0 Likes

#4

Hi, just in case people are still have this issue with multi-line media queries not having the correct syntax highlighting in Sublime Text, there is a package available called CSS3 available from the package installer, (CTRL+ SHIFT + P > Install > CSS3); it does the trick.

1 Like

#5

Thanks thepixelworx, this has been annoying me for some time – finally enough to actually search for an answer.

The CSS3 package really should be default by now…

0 Likes