Motivated by Gmail's Terminal theme, I hacked a similar theme for an internal Web site using Firefox's Greasemonkey and Stylish add-ins. My approach was to write some small Greasemonkey scripts to touch up different parts of all pages independently, then use Stylish to apply style definitions (the theme) from one CSS file. If you want to create another theme for this site, just create a new CSS file.
- First, I identified logical components of each web page, for example navigation bar, header, footers, forms and tables.
- Wrote a Greasemonkey script for each logical component that:
- Removed any physical formatting such as border or bgcolor.
- Labelled each component with an ID and / or a class name.
- When naming each script, prefixed each script name with the site name to make them easy to find in Greasemonkey's Manage User Scripts dialog.
- Configured Greasemonkey's Included and Excluded pages to call each script as required.
- Wrote a site-wide CSS file, using the IDs and class names that were previously defined.
- Added the CSS file to Stylish. The CSS file name is prefixed with the site and theme name.
Instant theme!
No comments:
Post a Comment