meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| wiki:dokuwiki-css-doc [25/08/2021 06:52] – [Styling based on page property] ztrulphcs | wiki:dokuwiki-css-doc [25/08/2021 07:21] (current) – ztrulphcs | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | Most of [[: | + | using css... bla bla bla |
| - | All CSS files are fetched through a single dispatcher in [[xref> | ||
| - | ===== Stylesheet Modes ===== | ||
| - | |||
| - | There are five types of stylesheet modes: | ||
| - | |||
| - | * **screen**: This is used when displaying pages in the web browser | ||
| - | * **print**: Definitions here will be used for printing pages | ||
| - | * **all**: Applied in all display modes | ||
| - | * < | ||
| - | * **feed**: Applied when displaying the [[: | ||
| - | |||
| - | ==== RTL styles ==== | ||
| - | |||
| - | The RTL mode has [[devel: | ||
| - | |||
| - | <code css> | ||
| - | .someClass { | ||
| - | float: left; | ||
| - | background-color: | ||
| - | } | ||
| - | [dir=rtl] .someClass { | ||
| - | float: right; | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | ===== DokuWiki Stylesheets ===== | ||
| - | |||
| - | [[: | ||
| - | |||
| - | |||
| - | ==== 1. Base Stylesheets ==== | ||
| - | |||
| - | These stylesheets are located within ''/ | ||
| - | |||
| - | ==== 2. Plugins Styles ==== | ||
| - | |||
| - | Plugins may define their own style definitions using the following files: | ||
| - | |||
| - | ^ Mode ^ CSS File ^ | ||
| - | | screen | ||
| - | | print | '' | ||
| - | | all | '' | ||
| - | | < | ||
| - | | feed | '' | ||
| - | |||
| - | Stylefiles with extension '' | ||
| - | |||
| - | To fit in well into any template' | ||
| - | |||
| - | :!: Stylesheets from plugins are loaded even if a plugin is not used (but not if a plugin is [[plugin: | ||
| - | |||
| - | :!: Styles defined here should take care of conflicts. So please be careful when writing a plugin. If possible add a prefix to your styles so that you're sure they won't conflict. | ||
| - | |||
| - | ==== 3. Templates Styles ==== | ||
| - | |||
| - | Template' | ||
| - | |||
| - | * Changes to '' | ||
| - | * See also: [[templates|Template Development]] | ||
| - | |||
| - | ==== 4. User Styles ==== | ||
| - | |||
| - | Additional styles, independently from the used template can be defined by the wiki administrator by creating the following CSS files in the wiki's configuration folder ('' | ||
| - | |||
| - | ^ CSS File ^ When it is used ^ | ||
| - | | '' | ||
| - | | '' | ||
| - | | < | ||
| - | | '' | ||
| - | | '' | ||
| - | |||
| - | (Note: the '' | ||
| - | |||
| - | These style files are useful to override small portions of template or plugin styles without running into problems on updating those later. | ||
| - | |||
| - | The following example reduces the bottom margin of the h2 and h3 headings when viewing in browser: | ||
| - | <code css userstyle.css> | ||
| - | h2, h3 { | ||
| - | margin-bottom: | ||
| - | } | ||
| - | |||
| - | </ | ||
| ===== Using IDs ===== | ===== Using IDs ===== | ||
| Line 174: | Line 91: | ||
| - | |||
| - | ===== Using images and importing styles ===== | ||
| - | |||
| - | Relative links to images ('' | ||
| - | |||
| - | An example: In a plugin, you want to use an image in the sub directory '' | ||
| - | |||
| - | <code css> | ||
| - | .someclass { | ||
| - | | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | DokuWiki will automatically change the URL, so that the image will be found in the plugin directory, relative to the template directory. | ||
| - | |||
| - | **Notes**: | ||
| - | * '' | ||
| - | * '' | ||
| - | |||
| - | ===== Caching ===== | ||
| - | |||
| - | All CSS files are fetched through a single dispatcher in '' | ||
| - | |||
| - | If you are making changes, ensure that you refresh the cache of your browser by a //Hard reload/ | ||
| - | |||
| - | ===== Browser (Internet Explorer) Specific CSS ===== | ||
| - | |||
| - | DokuWiki does not provide features to address browser specific CSS rendering, therefore any standard approach can be used in your template files. | ||
| - | |||
| - | The [[https:// | ||
| - | |||
| - | This wrapper method inserts a specific CSS style ID around the entire content. Your template .css file (design.css, | ||
| - | |||
| - | <code css> | ||
| - | #IE8 # | ||
| - | ...css styles... | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | You will need to edit the files in your template (ie. '' | ||