User agent stylesheet

From PowerUI
Jump to: navigation, search

Like ordinary web browsers, PowerUI also contains its own user agent stylesheet. These define the core styles as well as the appearance of scrollbars, input elements etc as they're all just pure HTML too. PowerUI's stylesheet is mainly a modified version of the ones from Gecko (Firefox). It's available at this location:

  • PowerUI/Resources/xhtml-style.html

Note that it is actually a .css file but Unity doesn't recognise 'css' as a text file type.

There's a few other stylesheets around, such as the one for MathML:

  • PowerUI/Source/Extras/MathML/Resources/mml-style.html

Extending without editing

You can add global styles by creating a file called customStyle.html in any Resources folder to extend the XHTML stylesheet. The rules you put in there will be applied to every document.

Style overriding

You can also just override the user agent rules by declaring them in your document like normal, i.e. via a style element or a link tag to a remote stylesheet. The main thing is to know what elements to style!


It's very common to style scrollbars but doing so is not standardised. See the wiki page specifically for scrollbars.