The GUI library was a really interesting problem. I think I came up with a pretty good solution: don't try and style in the common code.
It's suicide. It's too complicated of a beast to write.
I chose to do it kind of like how you define structure with HTML and syle with CSS.
Only difference is positioning is moved to the HTML-style portion and CSS is defined in the platform implementation, which is swappable.