Theme changes in 2.0: Difference between revisions
From MoodleDocs
(New page: {{Moodle 2.0}} * '''PROJECT STATE: Proposal''' * '''MAIN TRACKER ISSUE''': n/a * '''DISCUSSION AND COMMENTS''': n/a * '''AUTHOR''': [[User:Petr Škoda (škoďák)|Petr Škoda (škoďák)]...) |
|||
Line 16: | Line 16: | ||
=Design description= | =Design description= | ||
All theme files will be served through two files ''/theme/styles.php'' and '/'theme/image.php''. If more advanced themes need extra javascript files we could add optional ''/theme/javascript.php'' file. | |||
All CSS style sheets (including YUI, plugin CSS and parents) would be merged into single large CSS file served via the /theme/styles.php file, it would have several parameters: | |||
* theme - string, theme name | |||
* rtl - bool, modified style sheet for RTL languages | |||
* iehack - 6/7, IE would include special IE6/7 incompatibility fixes (this means IE 6 and 7 loads two styles.php instead of one) | |||
The theme config.php would be significantly simplified, the complete list of available options would be: | |||
* <code>$THEME->parents = array('standard', 'purple');</code> lists all parents top-down, each theme contains full list of parents, this is non-recursive and more flexible specification without any limits | |||
* <code>$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color');</code> the same as before, lists files from current theme directory | |||
* <code>$THEME->parents_exclude_sheets('standard'=>array('styles_moz'), 'purple'=>array('styles_fonts.css'));</code> it would be also posssible to use ''true'' instead of array in order to specify ''all'' sheets or all sheets in all parents | |||
* <code>$THEME->plugins_exclude_sheets('mod_book', 'gradereport_grader');</code> - specify individual components that should be excluded from this theme | |||
* <code>$THEME->layouts = array(...);</code> - the same as before, cascades through parent themes | |||
* resource and filter hacks $THEME->resource_mp3player_colors, $THEME->filter_mediaplugin_colors |
Revision as of 11:31, 20 August 2009
Moodle 2.0
- PROJECT STATE: Proposal
- MAIN TRACKER ISSUE: n/a
- DISCUSSION AND COMMENTS: n/a
- AUTHOR: Petr Škoda (škoďák)
Goals
The main goals are:
- general simplification of code
- easier theme customizations
- allow themes to be stored in dataroot
- improved performance
- base all themes on YUI CSS foundation
- easy customisation of theme images (similar to smartpix)
Design description
All theme files will be served through two files /theme/styles.php and '/'theme/image.php. If more advanced themes need extra javascript files we could add optional /theme/javascript.php file.
All CSS style sheets (including YUI, plugin CSS and parents) would be merged into single large CSS file served via the /theme/styles.php file, it would have several parameters:
- theme - string, theme name
- rtl - bool, modified style sheet for RTL languages
- iehack - 6/7, IE would include special IE6/7 incompatibility fixes (this means IE 6 and 7 loads two styles.php instead of one)
The theme config.php would be significantly simplified, the complete list of available options would be:
$THEME->parents = array('standard', 'purple');
lists all parents top-down, each theme contains full list of parents, this is non-recursive and more flexible specification without any limits$THEME->sheets = array('styles_layout', 'styles_fonts', 'styles_color');
the same as before, lists files from current theme directory$THEME->parents_exclude_sheets('standard'=>array('styles_moz'), 'purple'=>array('styles_fonts.css'));
it would be also posssible to use true instead of array in order to specify all sheets or all sheets in all parents$THEME->plugins_exclude_sheets('mod_book', 'gradereport_grader');
- specify individual components that should be excluded from this theme$THEME->layouts = array(...);
- the same as before, cascades through parent themes- resource and filter hacks $THEME->resource_mp3player_colors, $THEME->filter_mediaplugin_colors