====== Stylesheet ====== [[dokuwiki|DokuWiki's]] presentation can be controlled completely by changing its stylesheets (CSS). The default template includes five stylesheets: \\ \\ | ''design.css'' | [[http://dev.splitbrain.org/view/darcs/dokuwiki/lib/tpl/default/design.css|view]] | [[http://dev.splitbrain.org/download/darcs/dokuwiki/lib/tpl/default/design.css|download]] | controls the look of dokuwiki's "chrome", that's the titles, bars, buttons, etc. | | ''layout.css'' | [[http://dev.splitbrain.org/view/darcs/dokuwiki/lib/tpl/default/layout.css|view]] | [[http://dev.splitbrain.org/download/darcs/dokuwiki/lib/tpl/default/layout.css|download]] | controls the look of the wiki page itself | | ''media.css'' | [[http://dev.splitbrain.org/view/darcs/dokuwiki/lib/tpl/default/media.css|view]] | [[http://dev.splitbrain.org/download/darcs/dokuwiki/lib/tpl/default/media.css|download]] | controls the appearance of the media manager | | ''print.css'' | [[http://dev.splitbrain.org/view/darcs/dokuwiki/lib/tpl/default/print.css|view]] | [[http://dev.splitbrain.org/download/darcs/dokuwiki/lib/tpl/default/print.css|download]] | controls what gets printed and how it looks | | ''rtl.css'' | [[http://dev.splitbrain.org/view/darcs/dokuwiki/lib/tpl/default/rtl.css|view]] | [[http://dev.splitbrain.org/download/darcs/dokuwiki/lib/tpl/default/rtl.css|download]] | makes layout corrections to support right to left languages | These files can be found in ''/lib/tpl//'' ===== Customizing a style sheet ===== Although it is possible to modify the default template stylesheets, it makes more sense to make a copy of the whole template, change the dokuwiki template setting to the new template and modify the CSS files of the new template. This way, if there are any problems, you can always change the template setting back to ''default''. For more information on how DokuWiki handles stylesheets (including how to properly use IDs) and its CSS dispatcher refer to [[wiki:devel:css]]. For information about templates, and a list of available templates refer to [[wiki:tpl:templates]]. ===== Repairing a style sheet ===== Simply copy over the problem stylesheet with an original, either from your most recent Dokuwiki download or from the most recent sources in the link(s) above. ===== More Stylesheet Resources ===== * [[wp>Cascading_Style_Sheets]] From Wikipedia, the free encyclopedia. * [[http://www.w3schools.com/css/|W3Schools]], free tutorials. * [[http://htmldog.com/|HTML Dog]], free HTML/CSS tutorials and reference. * [[http://www.csscreator.com/css-forum/|CSS Creator Forums]], free CSS help and discussion. ====== CSS Stylesheets ====== All parts of [[wiki:DokuWiki]]'s design are controlled through CSS stylesheets. These files are located in various places but are fetched through a single dispatcher in ''lib/exe/css.php'' which also handles caching, pattern replacement and optimizing. Certain aspects of handling the CSS files can be configured on a per [[wiki:tpl:template]] basis through an ini file named ''style.ini'' in the template directory. ===== Using IDs ===== When you use custom IDs in your template for assigning styles, be sure that the ID does not conflict with an existing ID. In particular, be sure that it won’t conflict with the IDs automatically assigned to section headers. The easiest way to ensure this is to use two adjacent underscores (%%__%%) in your ID. Because section IDs are always valid [[wiki:pagenames]], they will never contain adjacent underscores. ===== Stylesheet Loading ===== DokuWiki always loads certain basic stylesheets. Which files from the template should be loaded additionally is configured in the ''[stylesheets]'' section of the ''style.ini''. Stylesheets need to be defined as key = value pairs with the name of the stylesheet on the left side and the output mode on the right. Possible modes are currently ''screen'', ''rtl'' and ''print''. ''screen'' is the normal mode when the page is viewed in the browser. The ''rtl'' stylesheet is loaded additionally to the screen sheets when a right-to-left [[wiki:multilanguage|language]] language is configured. The ''print'' styles are used when a page is printed. Here is a list of all loaded stylesheets and their order. The following style sheets are loaded in **screen mode** - lib/styles/style.css - styles from lib/tpl/