billymoon / Stylus

Stylus Package for Sublime Text 2 / 3
Other
129 stars 31 forks source link

@media queries without brackets {} breaks syntax highlighting #68

Closed hworld closed 8 years ago

hworld commented 8 years ago

Syntax definition for media query blocks without brackets fails. Example:

@media screen and (max-width: 500px)
    a
        color: #fff

With the brackets {} around around the media block it works.

Just wanted to say great work on the syntax file! It's pretty amazing how much it supports of Stylus's crazy syntax.

grassator commented 8 years ago

Can you please clarify what doesn't work and maybe make a screenshot? Looks the same to me with or without braces:

media queries

hworld commented 8 years ago

Ah, it must be a weird issue with Visual Studio Code, then. Will close it out since it's probably just Code failing at parsing the rules somehow.

hworld commented 8 years ago

Hey, I figured out what it is... I use $vars for all my media queries. I believe that's what actually breaks it for me:

@media $media-sm-up
  a
    color: #fff
grassator commented 8 years ago

Works for me as well... media-with-var

hworld commented 8 years ago

Bah, it's gotta just be VS Code, then. It seems to highlight everything correctly except for this one case with variables with a $ after the @media. Probably more of an issue for them, then.

Sorry for wasting your time, and thanks for bearing with me!