Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: CLEO Moodle Theme Guidelines.

CLEO Moodle Theme Guidelines: Difference between revisions

From MoodleDocs
(Added the CLEO version we have at the moment)
 
No edit summary
 
Line 1: Line 1:
Guidelines for Theme Authors
Guidelines for Theme Authors
---------------------------
---------------------------
I wrote this set of guidelines 2/3 years ago, and i've yet to meet a theme author who has passed without dicsussion. I repost it here for more discussion.


It is imperative that themes are constructed in a way that minimises the
It is imperative that themes are constructed in a way that minimises the

Latest revision as of 22:02, 24 June 2009

Guidelines for Theme Authors


I wrote this set of guidelines 2/3 years ago, and i've yet to meet a theme author who has passed without dicsussion. I repost it here for more discussion.

It is imperative that themes are constructed in a way that minimises the impact they have on moodle upgrades and conforms to best practices. Here are some advice we would urge theme authors to follow:

1) Only override styles which are being modified by your theme, this ensures that changes in the standard style sheets are observed for future versions. This will also lower page loading times, preventing the need to download and parse unnecessary style sheets.

The most common theme problems we encounter are caused by themes which copy the whole layout/fonts/color stylesheets from the standard theme and then make one or two tweaks to this. This means that tweaks which are made to the standard theme in newer moodle versions are not observed.

A better approach is to make only the few changes needed in a blank stylesheet, CSS will then cascade down and add those tweaks on top of the base stylesheet. See the standardwhite theme for an example ( https://docs.moodle.org/en/Theme_basics#Small_changes )

2) Ensure your theme uses the correct theme directory variables, $CFG->themewww, $CFG->themedir and $CFG->httpsthemewww. We use a non-standard theme directory, so these variables must be used for your theme to function correctly. ( https://docs.moodle.org/en/Development:Theme_directory_guide )

3) Ensure your theme header and footers maintain XHTML compliance, preserving a consistent display experience and adhering to accessibility legislation.

4) Ensure themes only contains necessary files. Any template images or stray files which may have been in the theme folder during the production process are removed. This keeps theme size to a minimum & that ensures that users wont stumble upon pre-production files.

5) Ensure your theme is self contained and avoids references to externally hosted images or stylesheets.

6) Avoid the CSS @import declaration. Instead use the theme config file to import necessary stylesheets