Questions and answers on how to customize the default look of Foswiki for your own needs, using style sheets. For configuring page elements, see PatternSkinCustomization.
colors.css - border colors, text colors and background colors
When customizing your Foswiki installation, you can either choose to completely rewrite all css styles, or to selectively override some styles. The latter option is by far less time consuming, but all depends on your graphical wishes.
When you need lots of graphic changes: Rewriting CSS
Create a new topic that will contain your new CSS files
* Set FOSWIKI_LAYOUT_URL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/layout.css
* Set FOSWIKI_STYLE_URL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css
* Set FOSWIKI_COLORS_URL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/colors.css
When you need to make small adjustments: Adding to existing CSS
With CSS you cannot remove already defined classes, you can only add to it, or override existing styles.
Overriding default CSS is done with 3 preference settings: USERLAYOUTURL, USERSTYLEURL, USERCOLORSURL.
Create a new topic that will contain your new CSS files
Attach 1, 2 or 3 new style sheets to the topic, dependent on your CSS setup (if you don't change much, you might as well put everything in one CSS file, layout, margins and colors)
* Set USERLAYOUTURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/layout.css
* Set USERSTYLEURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css
* Set USERCOLORSURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/colors.css
If you use only little CSS and you've only attached one file, write:
* Set USERSTYLEURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css
Instead of setting these preferences in DefaultPreferences or SitePreferences, you can set these in your home topic, or in any other topic. Setting style URL preferences in:
Set the value of macro PATTERNSKIN_THEME_VARIANT to that topic attachment url using %PUBURL%/YourWebName/YourTopicName/your_theme_variant_file.css
Note: If using %WEBHEADERART% to customize the top bar, some #patternTopBarContents CSS is expanded inline from templates/css.pattern.tmpl. Override of some attributes, such as background color and repeat are not possible from the CSS files.