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.
PatternSkin uses 3 style sheets (attached to PatternSkin):
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.
* 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
USERLAYOUTURL
, USERSTYLEURL
, USERCOLORSURL
. USERXXXURL
preferences):
* Set USERLAYOUTURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/layout.css * Set USERSTYLEURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css * Set USERCOLORSURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/colors.css
* Set USERSTYLEURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css
Instead of setting these preferences in System.DefaultPreferences or Main.SitePreferences, you can set these in your home topic, or in any other topic. Setting style URL preferences in:
User styles are always loaded after Foswiki styles.
The rest of this topic shows examples of small CSS changes.
See example at: PatternSkinCssCookbookNoLeftBar
See example at: PatternSkinCssCookbookFonts
The height of the top bar is defined in theme
CSS files. The default height in theme_foswiki.css
is 90px, in theme_twiki.css
it is 64px.
This is the complete style definition to set the height of the top bar:#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter, #patternTopBarContents { height:64px; /* top bar height; make room for header columns */ overflow:hidden; }Change the number from 64px to your value.
- Create a new stylesheet (preferably a 'theme' file (see for instance http://www.wetherby.me/wiki/pub/System/PatternSkin/theme_foswiki.css with above definition in it
- Attach the file to a topic
- Set the value of macro
PATTERNSKIN_THEME
to that topic attachment url using%PUBURL%/YourWebName/YourTopicName/your_theme_file.css
See example at: PatternSkinCssCookbookNoTopBar
See example at: PatternSkinCssCookbookCenterPage
See example at: PatternSkinCssCookbookCenterPageBorder
See example at: PatternSkinCssCookbookEditTableStyle