If I recall correctly Nathan Harmon was able to do that within Pega Marketing. Hopefully he sees this and remembers the details, if I recall it involved the conditional invocation of skin rules from the presentation tab.
There are already some good responses here from Phani and David. Generally when we've needed to do this in Pega Marketing, we will approach this as they both suggested: two (or more, depending on use case) controls with the various relevant styling applied, and then mutually exclusive visibility conditions applied. The styling could be set up any number of ways - skin styles, custom CSS which you have access to, or (as a last resort, since it will generate a maintainability warning) inline CSS.
The other thing to note is that for the control to appear to update dynamically (for instance, if the styling is dependent on the value of the control after the user enters it), the control would have to post the value on change, and the containing layout should have a refresh condition checking for when that value changes. (Alternatively, if you'd like to prevent a full layout refresh and limit it to just your group of controls, each control can have "run visibility condition on client" selected).
Hope this helps!
Posted: 5 years ago
Updated: 5 years ago
Posted: 18 Feb 2016 13:08 EST Updated: 18 Feb 2016 13:15 EST