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):- layout.css - the positioning of main page elements (blocks), widths and heights
- style.css - fonts, sizes, margins and paddings
- colors.css - border colors, text colors and background colors
Changing the color scheme
Have a look at Pattern Skin Color Settings.When you need lots of graphic changes: Rewriting CSS
- Create a new topic that will contain your new CSS files
- Attach 3 new style sheets to the topic
- Point the CSS variables in TWiki.TWiki Preferences to your new files:
* 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. - 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)
- Point the CSS variables in TWiki.TWiki Preferences to your new files (below the
TWIKIXXXURLvariables):
* 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 variables in TWiki.TWiki Preferences, you can set these in your home topic, or in any other topic. Setting style URL variables in: - TWiki.TWiki Preferences: the style is visible for all users, site-wide
- Web Preferences: the style is visible for all users in one web
- Home topic: the style is visible for that one user when viewing the site
- Some other topic: the style is only visible in that one topic
Recipes
Hide the left bar
See example at: Pattern Skin Css Cookbook No Left BarUse different fonts
See example at: Pattern Skin Css Cookbook FontsNo top bar
See example at: Pattern Skin Css Cookbook No Top BarCentered page
See example at: Pattern Skin Css Cookbook Center PageCentered page (with a border around the page)
See example at: Pattern Skin Css Cookbook Center Page BorderSetting EditTablePlugin styles
See example at: Pattern Skin Css Cookbook Edit Table StyleStyle 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 } |