User agent stylesheet

From PowerUI
Revision as of 01:48, 13 March 2017 by 188.222.158.94 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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!

Scrollbars

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