1

I have a set of css tags like this:

.card.hidden.small.u-margin-bottom-1

I'd like to conditionally show the .hidden tag while maintaining this style of syntax (I have seen this slim dynamic conditional class and don't want to change style).

Could I do something like?

.card(.hidden if true_statement).small.u-margin-bottom-1

but this doesn't seem to work.

Nima
  • 3,309
  • 6
  • 27
  • 44
ibpix
  • 179
  • 1
  • 9

1 Answers1

0

You can do something like this:

.card.small.u-margin-bottom-1 class=(:hidden if true_statement)

for more classes:

.card.small.u-margin-bottom-1 class=('class-1 class-2' if true_statement)
blackchestnut
  • 1,259
  • 10
  • 15