Splitting BEM SCSS with parent selectors breaks Sublime Text syntax highlighting?

I am experimenting with BEM syntax in a project using SCSS. My editor is Sublime Text 3, and I use SCSS syntax highlighting.

The problem I am facing is that when I set the & selector with the parent selector in this article by Mike Fowler , Sublime underlines it red. Here is an example:

enter image description here

The code compiles fine, I would just rather have Sublime not flag this as errors.

Can someone help config Sublime do just that?

+8
sass sublimetext syntax-highlighting bem
source share
2 answers

I suggest using Syntax Highlighting for Sass for syntax highlighting. Using it and the Neon Color Scheme , which fully supports all areas in the Syntax Highlighting for Sass package (disclaimer: I support the theme), your code looks like this:

SHfS and Neon

no errors (green is the name of the class, and & is the special character SASS / SCSS). I'm not sure which package you use to highlight SCSS, but it obviously does not recognize leading characters -- or any of the following __ characters. Switching to a new syntax highlighting package should help.

+18
source share

I fixed this when I had this problem by choosing View> Syntax> SASS> SCSS. This is apparently caused by loading the original SASS Sublime package.

0
source share

All Articles