The Goal

I have two classes: "base" and either "condition-true" or "condition-false" depending on a server-side condition.

Using th:if

This HTML is duplicated. We probably want a better solution. This HTML is duplicated. We probably want a better solution.

Using th:attr

This HTML is consolidated, which is good, but the Thymeleaf attribute still has some redundancy in it.

Using th:class

The base CSS class still has to be appended with String concatenation. We can do a little bit better.

Using th:classappend

This HTML is consolidated, and the conditional class is appended separately from the static base class.