If you want to use Xojo WebStyles you would still create them at design time, but you could change their properties at run time. That frees you to treat styles as representing groups of controls (i.e. ButtonStyle, ListBoxStyle) or logical presentation (i.e. HeaderLarge) rather then a million style variations.
WebStyleTD objects are created at run time.
It’s up to you. If you apply a specific WebStyleTD instance to controls in multiple sessions, then yes, changing its properties affects all sessions. But you don’t have to do this. If each session has its own set of WebStyleTD instances then changes would not propagate across sessions.
Changing a Xojo WebStyle called cssWebStyleExtDemo using the convenience methods:
Changing CSS properties by name:
Changing a WebLabel directly:
Creating a WebStyleTD and applying it to a control:
objStyle = New WebStyleTD
WebStyleTD has numerous AddTo / RemoveFrom methods for applying the style to controls, parts of a list box, and toolbar items.
The convenience methods like FontFamilyTD can be called on WebStyle, WebStyleTD, and WebControl.
There are convenience methods and constants for setting text decoration (underline, strike through), and a convenience method for setting padding. But again, you can always use the value methods to explicitly set any CSS. Padding is one thing you could potentially run into problems with on some Xojo controls.
You can also initialize a WebStyleTD with CSS. Example:
objStyle = New WebStyleTD("border: 2px solid black; background-color: blue;")
So you could, for example, define an initial look for a control in raw CSS; create a WebStyleTD object at run time from that CSS and apply to the control; then change the style as the user selects values from popups, color pickers, etc.