The TextField, TextArea and PasswordField components (all children of AbstractTextField) accept a "class" attribute as an informal parameter. This is rendered correctly when the component is rendered normally.
However when the field has a validation error the ValidationDecorator will set class="t-error" before the informal attributes are added. This prevents any user supplied classes being rendered.
ValidationDecorator works correctly if the class attribute has already been written (it adds t-error it that case), the issue is that the AbstractTextField calls the decorator before the informal attributes are rendered.
I'm not sure of the best way to ensure the decorator is called after the informal parameters. The options I see are
a) remove the RenderInformals mixin from AbstractField & call renderInformalParameters explicitly
-> downside is other children of AbstractField also have to explicitly deal with informal parameters
b) make class an explicit parameter
-> downside is that it has to be added to attributes explicitly somewhere
c) move the validation render & decorate to the BeforeRenderTemplate phase
-> which feels a bit like a hack
I think option (a) is probably best.....
(happy to supply patch for whichever approach)