Basic stylesheets

These are my basic stylesheets and a Greasemonkey script to link them to a webpage when needed. Their main purpose is to make an unstyled HTML page look nice by setting various rules and generating colours.

This page calls styles.css.php?hue=random, so refreshing it gets you a random colour scheme.

styles.css.php

This can be passed a hue as a GET var (for example styles.css.php?hue=80). If a hue was not given this way and there is a referrer, the referrer’s hostname is hashed and that turned into a hue. Otherwise, a hue is chosen at random.

This stylesheet then includes basicstyles.css.php and basiccolourscheme.css.php with the chosen hue. Any other GET values are passed along to both other stylesheets.

basicstyles.css.php

This defines various styles but no colours. It can be passed the GET var noborder with value true to switch off the border.

basiccolourscheme.css.php

This defines the colours to complement basicstyles.css.php. A hue can be passed as for styles.css.php (otherwise, again, one is chosen at random), and certain styles are not set if the borders are switched off as above.

applystylesheet.user.js

A Greasemonkey script which adds a link to styles.css.php on the condition that no other stylesheet was either linked or included in the header for the screen or all media or if no medium was specified. The stylesheet will pick a hue based on the hostname.

Some sites (notably Google) are styled but don’t apply the stylesheet in the ways above and so they should be added Greasemonkey’s exclude list as you come across them.

applystylesheet.local.user.js

The same as above, but calling the sheet from perigee rather than perigee.tremby.net – only useful from within my network.