Skip to content

Instantly share code, notes, and snippets.

@matheusagcosta
Last active June 24, 2021 18:56
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 matheusagcosta/f7857596e27a515a901d38aa61f16948 to your computer and use it in GitHub Desktop.
Save matheusagcosta/f7857596e27a515a901d38aa61f16948 to your computer and use it in GitHub Desktop.
Toggle Pug or Jade class using ternary operator
// Jade
.item(class="#{ current.source != 'about' ? 'is-active' : '' }")
// Pug
.item(class=currentPath == 'index' ? 'is-active' : '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment