So far I've adopted this pattern:
scala> val someCondition = false
someCondition: Boolean = false
scala> val myClassAttr = if (someCondition) Some(`class` := "doSomethingSpecial") else None
myClassAttr: Option[scalatags.AttrPair] = None
scala> p(myClassAttr)("The contents of my paragraph")
res2: scalatags.HtmlTag = <p>The contents of my paragraph</p>
It would be better if there was a Boolean.toOption method, but that's somewhat beyond the scope of Scalatags. e.g. with scalaz you could write
val myClassAttr = someCondition.option(`class` := "doSomethingSpecial")
Which looks considerably better.