I would approach this with a ternary (or fully written out conditional or method) to determine the class attribute. That allows you to keep the div on one line and keeps indentation like it would be for any other element:
div(class="#{ isFixed ? 'fixed' : '' }")
p Inner Element