Does a package that "highlights" all PHP code blocks exist?

I’m just starting with PHP in Atom and I thought it’d be really cool if there was a package that “highlights” or puts some sort of border or background color onto anything that’s within the <?php ?> code blocks. Just so it sticks out visually.

I’ve had a bit of a search and haven’t found anything. Has anyone come across something like this?

Cheers! :blush:

You can simply add a rule to your editor’s stylesheet (see Stylesheet… in the Atom menu)

01

Example:

.syntax--embedded.syntax--php {
    background: yellow; /* ugly color for emphasis */
}

03

For a color that goes with your theme, you can use the LESS variables from the styleguide:

25

Example:

.syntax--embedded.syntax--php {
    background: @text-color-warning; /* to keep things yellowish */
}

You could further differentiate between single and multi line blocks by adding .syntax--line / .syntax--block to the CSS selector.

1 Like

@idleberg that is absolutely perfect. I didn’t know I could tweak Atom like that. I guess that’s why it’s called the hackable code editor :smiley:

Thanks again for that. It’s really helped.