Pattern Skin CSS Cookbook

Questions and answers on how to customize the default look of TWiki for your own needs, using style sheets. For configuring page elements, see Pattern Skin Customization.

First Read: How to modify PatternSkin styles

PatternSkin uses 3 style sheets (attached to Pattern Skin):

When customizing your TWiki 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.

Changing the color scheme

Have a look at Pattern Skin Color Settings.

When you need lots of graphic changes: Rewriting CSS

      * Set TWIKILAYOUTURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/layout.css
      * Set TWIKISTYLEURL = %PUBURLPATH%/%SYSTEMWEB%/YourNewTopic/style.css
      * Set TWIKICOLORSURL = %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 overwrite existing styles.
Overriding default CSS is done with 3 variables: USERLAYOUTURL, USERSTYLEURL, USERCOLORSURL.
      * 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 variables in TWiki.TWiki Preferences, you can set these in your home topic, or in any other topic. Setting style URL variables in:

User styles are always loaded after TWiki styles.

The rest of this topic shows examples of small CSS changes.

Recipes

Hide the left bar

See example at: Pattern Skin Css Cookbook No Left Bar

Use different fonts

See example at: Pattern Skin Css Cookbook Fonts

No top bar

See example at: Pattern Skin Css Cookbook No Top Bar

Centered page

See example at: Pattern Skin Css Cookbook Center Page

Centered page (with a border around the page)

See example at: Pattern Skin Css Cookbook Center Page Border

Setting EditTablePlugin styles

See example at: Pattern Skin Css Cookbook Edit Table Style

Style sheet documentation

See Pattern Skin Css for documentation of PatternSkin CSS classes



Topic PatternSkinCssCookbook . { Edit | Attach | Backlinks: Web All webs | Printable | History: r5 < r4 < r3 < r2 < r1 More }