Skip to content

Instantly share code, notes, and snippets.

@Amberlamps
Created November 8, 2014 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Amberlamps/93346b5fd2111191a65e to your computer and use it in GitHub Desktop.
Save Amberlamps/93346b5fd2111191a65e to your computer and use it in GitHub Desktop.
How to get rid of if/else statements and additional classes when it comes to highlighting the selected item in a menu/navigation
.navigation li[data-selected] {
font-weight: bold;
}
ul.navigation
li(data-selected=(page === 'home')) Home
li(data-selected=(page === 'games')) Games
li(data-selected=(page === 'movies')) Movies
li(data-selected=(page === 'music')) Music
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment