Skip to topic
|
Skip to bottom
Jump:
TWiki
PyqPlayer
Download
Documentation
FAQs
Welcome
Register
TWiki Web
TWiki Web Home
Changes
Topics
Index
Search
Other TWiki Webs
Main
Sandbox
TWiki
Create
personal sidebar
Edit
Attach
Printable
TWiki.PatternSkinCustomization
r1.3 - 28 Aug 2004 - 22:59 -
ArthurClemens
?
topic end
Start of topic |
Skip to actions
---+!! Customization of !PatternSkin This page describes ways to change the layout, fonts and colors of PatternSkin. %TOC{title="Page contents:"}% ---++ Your own TWiki look You can easily create your own TWiki look by attaching modified css files to your home page: * If you want to change the layout of the page, download layout.css from TWiki.PatternSkin * If you want to change the spacing or colors, download style.css from TWiki.PatternSkin * modify the CSS in either style sheet, using tips from this page * [[%SCRIPTURL%/attach%SCRIPTSUFFIX%/%MAINWEB%/%WIKINAME% attach]] your modified !layout.css and/or !style.css to your home page * as shown below, add the =USERLAYOUTURL= and =USERSTYLEURL= settings to [[%MAINWEB%.%WIKINAME%][your home page]] <verbatim> * Personal TWiki.PatternSkin CSS settings * Set USERLAYOUTURL = %PUBURL%/%MAINWEB%/%WIKINAME%/layout.css * Set USERSTYLEURL = %PUBURL%/%MAINWEB%/%WIKINAME%/style.css </verbatim> ---++ Screen parts The !PatternSkin view template uses four screen parts: * The topic part - contains besides the topic content: action buttons, form table, attachment table, topic info * Top bar - used for a logo, contains Go box * Left bar - site and web navigation, contains a personal link block; may contain a Go box * Bottom bar - copyright, disclaimer These parts are dynamically included topics: * Top bar: TWiki.WebTopBar * Left bar: included topic WebLeftBar (one !WebLeftBar topic per web) * Personal links block: %MAINWEB%.%<nop>USERNAME%LeftBar. Your own personal leftbar: %MAINWEB%.%USERNAME%LeftBar * Bottom bar: included topic TWiki.WebBottomBar ---+++ Top bar The top bar is mainly used as branding space. To change the screen room for the logo, see below, [[%TOPIC%#Customizing_the_logo][Customizing the logo]]. ---+++ Left bar The menu items are css-formatted bullet lists. So in WebLeftBar you write: <verbatim> * *Group* * [[SomeTopic][Link 1]] * [[AnotherTopic][Link 2]] * [[ThirdTopic][Link 3]] </verbatim> The left bar may contain a Go box instead of the top bar. Use: <verbatim> * <input type="text" name="topic" size="16" /> </verbatim> The personal left bar block is formatted like the rest of the left bar. ---++++ Putting the left bar at the right If you have a low screen resolution of say, 640 by 480 pixels, it can be useful to put the left bar "out of the way", at the right side of the page - at the cost of a horizontal scroll bar to access the left (now right) bar. This CSS does this: <blockquote> Add this to layout.css: <!-- /* --> <verbatim> .twikiMain { margin-left:0px; } .twikiLeftBar { margin-left:100%; } .twikiBottomBar { margin-left:1em; margin-right:0; padding:0; } </verbatim> <!-- */ --> Add this to style.css: <!-- /* --> <verbatim> .twikiMain { padding-left:1em; padding-right:1em; } .twikiBottomBarContents { padding-left:0em; } </verbatim> <!-- */ --> </blockquote> This CSS is also attached to this topic, [[%ATTACHURL%/LowRes.css][LowRes.css]]. To use this style, add this to your home page: <verbatim> * Personal TWiki.PatternSkin CSS settings * Set USERLAYOUTURL = %PUBURL%/%SYSTEMWEB%/PatternSkinCustomization/LowRes.css </verbatim> ---+++ Bottom bar The bottom bar contains the copyright disclaimer, but may contain other information, perhaps a web list. ---++ Customizing the logo The top bar is 60 pixels high, and has a padding of 5 pixels on top, bottom and left, so the logo should be 50 pixels high. If your logo image has a different size, you can either alter the padding in =style.css= (.twikiTopBarContents) or change the top bar height in =layout.css= (look for the comment _setting the height of the top bar_). You can also choose to set a background image for the top bar. In =style.css=, add this to .twikiTopBar: <verbatim> background-position:top left; background-attachment:fixed; background-repeat:no-repeat; background-image:url(http://absolute_path_to_your_image); </verbatim> and set the correct image file path. ---++ Fonts ---+++ Font style Font styles are defined in =style.css= in these places: <!-- /* --> <verbatim> html body { font-family:"Lucida Grande", verdana, lucida, helvetica, sans-serif; } h1, h2, h3, h4, h5, h6 { font-family:"Lucida Grande", helvetica, lucida, verdana, sans-serif; } textarea { font-family:monospace; } input, select { font-family:verdana,arial,sans-serif; } .twikiSeparator { font-family:Arial,sans-serif; } .twikiEditPage .twikiSig input { font-family:monospace; } </verbatim> <!-- */ --> ---+++ Font size Font sizes in !PatternSkin are scalable. This means that even on Windows Explorer, the text in the browser can scale with the user settings (in contrast to many sites where texts have a fixes pixel size, these cannot be changed by the user). Scalable text is a big accessibility asset. If you notwithstanding want to have a fixed font, or if you want to set the default size smaller or bigger, the easiest way is to make a new entry for body, below the 2 other entries: <!-- /* --> <verbatim> html body { ... (keep) } html>body { ... (keep) } html body { font-size:11px; } </verbatim> <!-- */ --> ---++ Colors <span style="background:#000000" > </span><span style="background:#041d3a" > </span><span style="background:#05264d" > </span><span style="background:#333333" > </span><span style="background:#334455" > </span><span style="background:#880000" > </span><span style="background:#990000" > </span><span style="background:#844f0c" > </span><span style="background:#22638c" > </span><span style="background:#666666" > </span><span style="background:#3db234" > </span><span style="background:#1559b3" > </span><span style="background:#1e5bbd" > </span><span style="background:#808080" > </span><span style="background:#888888" > </span><span style="background:#e24628" > </span><span style="background:#698fa8" > </span><span style="background:#9e9e70" > </span><span style="background:#888e9c" > </span><span style="background:#8490a1" > </span><span style="background:#ff0000" > </span><span style="background:#ff3000" > </span><span style="background:#98a2b0" > </span><span style="background:#aaaaaa" > </span><span style="background:#bbbbbb" > </span><span style="background:#a3bcf1" > </span><span style="background:#cccccc" > </span><span style="background:#ffff00" > </span><span style="background:#b9d6fa" > </span><span style="background:#dadada" > </span><span style="background:#b4d5ff" > </span><span style="background:#dddddd" > </span><span style="background:#e9e9e9" > </span><span style="background:#e0e9f7" > </span><span style="background:#efedea" > </span><span style="background:#f3ede7" > </span><span style="background:#dfedfd" > </span><span style="background:#eeeeee" > </span><span style="background:#ebf7ea" > </span><span style="background:#efefef" > </span><span style="background:#ffeae5" > </span><span style="background:#e8f1f9" > </span><span style="background:#f1f1f1" > </span><span style="background:#f2f2f2" > </span><span style="background:#f8f8f8" > </span><span style="background:#f5f7fd" > </span><span style="background:#fcfaf7" > </span><span style="background:#ffffff" > </span> To create a customised palette of colors, see PatternSkinPalette. ---++ Tables ---+++ Tables in topic text If you have TablePlugin installed, tables in topics take on the properties from =TABLEATTRIBUTES=. Without TablePlugin (if not installed, or disabled in TWikiPreferences under =DISABLEDPLUGINS=), the tables have a default appearance that is hardcoded in Render.pm. Styles of topic text tables are not set in a style sheet. If you want to have control over the design of tables, for instance if you work with a style guide, you should add table styles under =.twikiTopic=. See for an example below. ---++++ Topic text table example This is an example css to give tables in topic text a similar appearance. This will override settings in TablePlugin. This code should be added below the other =.twikiTopic= code in style.css: <!-- /* --> <verbatim> .twikiTopic table { border-collapse:collapse; padding:0px; border-spacing:0px; empty-cells:show; border:0px; } .twikiTopic table th { background-color:#ccc; padding:0.5em 1em; } .twikiTopic table td { border:1px solid #eee; } /* override hardcoded font color */ .twikiTopic table font { color:#1e5bbd; } .twikiTopic table th a:link, .twikiTopic table th a:visited { color:#1e5bbd; text-decoration:none; } /* don't show hover background color because we have a table header background */ .twikiTopic table th a:hover { background-color:transparent; text-decoration:underline; border-width:1px; } /* no underline if a sort indicator (line) is displayed */ .twikiTopic table th.twikiSortedDescendingCol a:hover, .twikiTopic table th.twikiSortedAscendingCol a:hover { text-decoration:none; } /* hide sort icons */ .twikiTopic table th img, .twikiTopic table th a:link img, .twikiTopic table th a:visited img { display:none; } </verbatim> <!-- */ --> ---+++ Attachment table, Form table The appearance of the form table and the attachment table are set in style.css under =.twikiForm= and =.twikiAttachments=. Text in these tables is set to wrap, so often the dates are wrapped to two lines. If you prefer to have text on one line and are not disturbed by an extra wide attachment table (or when you screen resolution is big enough), add this code to =.twikiAttachments td, .twikiForm td {=: <!-- /* --> <verbatim> white-space:nowrap; </verbatim> <!-- */ --> ---+++ Other templates Other templates than =view= use the style =.twikiVersatileTable= for, as the name says, tables with versatile functions. Versatile tables appear a little diffent in each template page (differences are created using multiple classes). Versatile tables are mostly used to format forms to highlight important parts and to dim less important parts. See =style.css= for specific settings for each template. -- TWiki:Main.ArthurClemens - 28 Aug 2004
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.3 |
>
|
r1.2
|
>
|
r1.1
|
Total page history
|
Backlinks
You are here:
TWiki
>
PatternSkinCustomization
to top
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Project hosting provided by:
Donations welcome: