I see. You're just not wanting to put an If construct into each property definition. Sure… I think it makes the code a bit harder to follow, but that's just a personal aesthetic. What would perhaps be easier is to create a variable, $css, that contains 'red' if there are warnings and " if not, and just concatenate that to the individual expressions – which are left or right regardless.
↧