[pmwiki-users] Edit template to use for documenting a new skin?

Petko Yotov 5ko at 5ko.fr
Tue Sep 18 02:43:39 CDT 2012


tamouse mailing lists writes:
> Here's the dilemna: do I include style information for div.toc and
> descendants in skin.css (probably not because other users may not use
> that recipe), or should that go in local.css?

For my recipes (not skins) I suggest in the documentation to add+adapt  
styles in local.css.

Any styles for a table of contents should be minimal IMO. If the toc recipe  
injects some unwanted CSS like colors of text/background/borders that don't  
match your theme, you can disable them from your skin.php file like this:

  global $HTMLStylesFmt;
  $HTMLStylesFmt['toc'] = '';
  $HTMLStylesFmt['tocf'] = '';

That way you may not be required to change many styles, use !important, etc.

Also, consider that admins installing your skin have some knowledge of CSS.  
So if something isn't appearing correctly, they can likely fix it and/or  
tell you how to fix it (or at least report and let you fix it).

> I'm not sure how I'd be able to
> alter local.css based on the skin theme.

You cannot, but this may be possible. In the skin template:
   <body class="{$ColorTheme}">

In skin.css, only color-independent styles:
  div.toc { font-size: smaller; padding: .4em; margin-bottom: 1em;}
  div.toc a { text-decoration; none; }
  div.toc a:hover { text-decoration; underline; }

In local.css:
  body.pinky div.toc { border-color: red; }
  body.water div.toc { border-color: blue; }

This is not an obligation, you can suggest placing everything in local.css.  
There is more than one correct way to do things.
 
Obviously, the "div.toc a:hover" above is a (bad) example, you'd better just  
define the global a and a:hover styles in the skin and let the toc anchors  
inherit these styles.

Also, maybe look at some of the existing complex skins which allow color  
themes. We have some experienced people who know PmWiki very well and have  
created a number of popular skins. You can see how they did and even ask  
them questions.

Petko




More information about the pmwiki-users mailing list