using css… bla bla bla
When you use custom IDs in your template for assigning styles, be sure that the ID does not conflict with an existing ID. In particular, be sure that it won’t conflict with the IDs automatically assigned to section headers. The easiest way to ensure this is to use two adjacent underscores (__) in your ID. Because section IDs are always valid pagenames, they will never contain adjacent underscores.
In plugins use <pluginname>__<id>. For example 'searchindexplugin__buttonfield'
Most often people only need to modify a style of some element on all pages. For example one may want to change the font style for h1 heading. But from time to time, it is desirable to modify a style only on certain page. You could want a special background for any page in the attic namespace so that readers instantly realize that they are reading outdated documentation left as a reference. One could also want to add a specific style to some elements if visitor is a connected user, or only on edit page but not when viewing the page. This is possible because most template use an internal DokuWiki function called tpl_classes(). All you need to know is that this function is used by templates to add classes based on page properties to one of the top div element. For example, when a connected visitor is reading the page :wiki:syntax the default template produces this div element :
<div id="dokuwiki__top" class="site dokuwiki mode_show tpl_dokuwiki loggedIn showSidebar hasSidebar lv_1 ns__wiki ns_wiki_ pg_syntax pg_wiki_syntax">
This offers quite a lot of possibilities. you can create a style for
div.dokuwiki.pg_wiki_syntax { background: red; h1 { text-transform: uppercase; } }
div.dokuwiki.loggedin.lv_1.mode_show { background: red; h1 { text-transform: uppercase; } }
If your particular template does not use the tpl_classes() function, you will have different classes available. In fhis case, you may want to contact the developer of your theme and ask that the template makes use of this function.
Enough examples, here are the details :
dokuwikimode_<ACT>mode_view. But see action_modes for a list of action modes. Note that plugins may create more actions.tpl_<name_of_template>tpl_dokuwiki. If you use the sprintdoc, this will be tpl_sprintdoc. and if you use the Art for water template, this will be tpl_artforwater.loggedIn:not() CSS pseudo class.notFoundnotFound class in its main DW div.homeshowSidebar and hasSidebarlv_<X>lv_0 ; for the page devel:css this will be 1, lv_1 and for fr:plugin:struct:aggregation, this will be 3, lv_3.ns__<namespace-chain>_ separator. If a namespace has an _ in its name, then this result in a __ in the class name. examples ::start ⇒ class ns__fr:plugin:struct:aggregation ⇒ 3 classes are added :ns__frns__fr_pluginns__fr_plugin_structmatching_food_and_drinks:big_juicy_steak:pan_galactic_gargle_blaster ⇒ 2 classes added :ns__matching__food__and__drinksns__matching__food__and__drinks_big__juicy__steakns_<last_ns_component>_ns__ which is already added by the previous rule. Examples ::start ⇒ nothingfr:plugin:struct:aggregation ⇒ class ns_aggregation_matching_food_and_drinks:big_juicy_steak:pan_galactic_gargle_blaster ⇒ class ns_big__juicy__steak_pg_<full-page-id>_ in page name are also doubled in the class name. examples : :start ⇒ pg_startfr:plugin:struct:aggregation ⇒ class pg_fr_plugin_struct_aggregationmatching_food_and_drinks:big_juicy_steak:pan_galactic_gargle_blaster ⇒ class pg_matching__food__and__drinks_big__juicy__steak_pan__galactic__gargle__blasterpg_<rel-page-id>:start ⇒ nothingfr:plugin:struct:aggregation ⇒ class pg_aggregationmatching_food_and_drinks:big_juicy_steak:pan_galactic_gargle_blaster ⇒ class pg_pan__galactic__gargle__blasterTo target all start page in any namespace use this
div.dokuwiki.pg_start
To target the main page
div.dokuwiki.home
To target a page exactly in the fr namespace
div.dokuwiki.ns__fr.lv_1
To target a page anywhere in the fr namespace (meaning fr:syntax or fr:plugin:struct:aggregation)
div.dokuwiki.ns__fr
To target “this page does not yet exist” in any namespace when using the boozurk template and only for anonymous user and when user is viewing the page but not editing it
div:not(.loggedIn).dokuwiki.notFound.mode_show.tpl_boozurk
CSS accepts fnencode settings