[pmwiki-users] Problems with the embedded CSS in pmwiki.php

Hans design5 at softflow.co.uk
Sun Oct 29 15:30:05 CST 2006


Sunday, October 29, 2006, 6:21:22 PM, marc wrote:

> In the recommended case:

>   <link rel='stylesheet' title="Skinname"  
>      href='$SkinDirUrl/Skinname.css' type='text/css' />
>   <!--HTMLHeader-->
>   </head>

> PmWiki comes in last (ignoring local customization), but in this case
> coming in last means that it wins. But, as we established before, by
> using:

>   <!--HTMLHeader-->
>   </head>

> and adding the following to skin.php

>   global $HTMLHeaderFmt;
>   $HTMLHeaderFmt['skin'] = 
>   "<link rel='stylesheet' href='\$SkinDirUrl/skin.css' 
>      type='text/css' />";

> the skin template wins by coming last.

I am coming in late on this discussion, but would like to make this
point:
A skin designer may have reason from a stylistic design perspective to
wish to override some of pmwiki core css styles. For this reason, and
for reasons of efficiency and reducing page loads, it would be good,
IMHO, to provide all pmwiki core css styles on a separate stylesheet
in pub/css/, which then could be easily checked, or changed or
overridden. The skin designer would add an extra line in the template
to facilitate loading of this pmwiki-core.css file. She can choose if
this will take place before or after loading any skin css file(s), or
indeed sandwiched between loading a primer and a later skin css file.
The design overhead is minimal, and no php code needed either:
For instance in the template like this:

<link rel='stylesheet' href='\$SkinDirUrl/skin1.css' type='text/css' />
<link rel='stylesheet' href='\$PubDirUrl/css/pmwiki-core.css' type='text/css' />
<link rel='stylesheet' href='\$SkinDirUrl/skin2.css' type='text/css' />
<!--HTMLHeader-->

</head>

And the skin template may contain an optional third (or the second one
moved down) css file after the <!--HTMLHeader-->, which would override
even any local css customisation (perhaps only desirable for a few css
settings).

We could move towards a standard pmwiki-core.css file already now,  by
pmwiki providing one in pub/css/, and having it loaded optionally by a
skin template, if the skin designer chooses to do so, and having
optionally the standard HTMLStylesFmt settings of pmwiki disabled.
This latter is unfortunately not quite so easy to do, but for the most
part I think it is possible, without the radical step of disabling
HTMLStylesFmt alltogether.

Then in time this optional loading of pmwiki-core.css can become the
standard, and the styles loaded by pmwiki with HTMLStylesFmt can be
discontinued.


Hans





More information about the pmwiki-users mailing list