HarlemSquirrel / language-haml

Haml language grammar for GitHub's Atom IDE
MIT License
33 stars 24 forks source link

Mixing text and variables hightlighting #53

Closed rubenmoya closed 8 years ago

rubenmoya commented 8 years ago

I've discovered that you can mix text and variables using Ruby/Haml interpolation like this:

%p Lorem ipsum #{variable} dolor sit amet

I think it would be nice if it were in other color and not white like it is right now:

screen shot 2015-12-07 at 22 36 33

Maybe I'm wrong and I shouldn't be doing that because it's not a good practice or something, so, what do you think guys?

ezekg commented 8 years ago

Well, that's going to vary depending on your syntax theme's Ruby coloring. Most syntax themes have white variables by default. If you want to change it, you can add something like this into your stylesheet config (Atom->Open Your Stylesheet) to override the color:

atom-text-editor,
atom-text-editor::shadow {

  // Adjust embedded Ruby variable colors
  .haml .meta.embedded.ruby {
    color: #f33 !important;
  }
}

That's perfectly valid Haml, btw. I use interpolation like that all the time. :+1:

rubenmoya commented 8 years ago

Thank you! That did the trick! :+1:

ezekg commented 8 years ago

No problem :+1: