<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnConfiguration/CascadingStyleSheets</title></articleinfo><section><title>Modifying the MoinMoin Default Style Sheets</title><para>If you wish to modify the default MoinMoin style sheet, it is a good practice to create a new theme first. Copy one of the existing themes to a new name (and also do not forget to copy the themename.py file, too). Use the @import function to import the original CSS file. Override only those attributes you wish to change. Then, if you later upgrade to a newer version of MoinMoin, any changes to the original CSS file will be incorporated automatically. </para><para>Example: </para><screen><![CDATA[@import url("/wiki/classic/css/screen.css");
]]><![CDATA[
body {
    background-color: #FAEBD7;  
    font-family: Arial,Helvetica;  
}]]></screen></section><section><title>Allowing Users to Choose a Style Sheet</title><para>To allow you users to choose between alternate style sheets, you first need to create several choices. Using the example above, change the background-color to <code>#E7FFE7</code> and save the file as <code>green.css</code> in <code>htdocs/mytheme/css/</code>. </para><para>Test this option by modifying your user preferences to select a <emphasis role="strong">CSS URL</emphasis> of <code>/wiki/mytheme/css/green.css</code>.  </para><para>Finally, you will probably need to edit <ulink url="http://www.ninux.org/HelpOnConfiguration/CascadingStyleSheets/HelpOnUserPreferences#">HelpOnUserPreferences</ulink> and change the wording for <emphasis role="strong">CSS URL</emphasis> to instruct your users on the choices available, including the new option for a green background. </para><para><emphasis role="strong">Note</emphasis>: When a user initializes or updates their UserPreferences, the default value for <emphasis role="strong">CSS URL</emphasis> will be empty. Any user can return to the default value by erasing the <emphasis role="strong">CSS URL</emphasis> field value and clicking the <emphasis role="strong"><ulink url="http://www.ninux.org/HelpOnConfiguration/CascadingStyleSheets/GetText%28%20Save%20%29#">GetText( Save )</ulink></emphasis> button. </para></section><section><title>How can I use my old .css style option with the new &quot;theme based&quot; moinmoin?</title><orderedlist numeration="arabic"><listitem><para>Select the theme you like the most, or is more like your old one. </para></listitem><listitem><para>Clone the selected theme into the wiki plugin directory. For example, if the <emphasis role="strong">classic</emphasis> theme is your departure point to create <emphasis role="strong">mytheme</emphasis>, then:  </para><orderedlist numeration="arabic"><listitem><para>Copy your <code>htdocs/classic</code> dir (containing the <code>css</code> and <code>img</code> subdirs) to <code>htdocs/mytheme</code> </para></listitem><listitem><para>Copy python/site-packages/MoinMoin/theme/classic.py to data/plugin/theme/mytheme.py </para></listitem><listitem><para>Add the following line to your <code>wikiconfig.py</code>: </para><screen><![CDATA[theme_default = 'mytheme']]></screen></listitem></orderedlist></listitem><listitem><para>Modify the mytheme CSS files (common.css, screen.css and print.css) to change the style and the mytheme.py to change order or appearance of elements in the produced html. At least, make sure that you change the value of the variable <emphasis>name</emphasis> to <emphasis> 'mytheme' </emphasis> (at the top of class <emphasis>Theme</emphasis>), otherwise your changes to the mytheme CSS files may have no effect. </para></listitem></orderedlist><para>In this way, you will already have your personal theme available to simplify new upgrades.  </para></section></article>