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

Patrick R. Michaud pmichaud at pobox.com
Mon Oct 30 10:06:05 CST 2006


On Mon, Oct 30, 2006 at 12:20:51PM -0000, marc wrote:
> Hans said...
> > 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. 

In my post I meant that "PmWiki comes in last" in the sense that
it has the least control over the output, and not that it occurs last
in CSS sequence.  In other words, PmWiki has the least control over
the final output, because the skin and/or admin can modify its
settings via $HTMLHeaderFmt and $HTMLStylesFmt.

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

> > [...]
> > The skin designer would add an extra line in the template
> > to facilitate loading of this pmwiki-core.css file.
> 
> I suspect that this CSS file would be loaded by default - so as not to 
> break the default install [where it would be loaded in any case, in your 
> scenario] and not to break any existing skins. 

Having the CSS file "loaded by default" doesn't at all resolve the
original issue that started this thread.  The only ways that a 
pmwiki-core.css file can achieve the desired semantics (admin
overrides skin overrides core) is by one of the following:

  - All templates explicitly load pmwiki-core.css at an appropriate location.

  - The skin has a skin.php file that manipulates $HTMLHeaderFmt.

  - We define an "automatically loaded skin.css" rule that adds
    a link to a per-skin css file between the pmwiki core CSS and
    any site-specific (local) CSS files.

Currently PmWiki goes with the second option.

> > We could move towards a standard pmwiki-core.css file already now,  by
> > pmwiki providing one in pub/css/
> 
> This is possible now, but Patrick is the oracle on the repercussions 
> that pass over us mortals ;-)

The problem is that transitioning the universe of existing PmWiki
installations and skins to exclusively use a standard pmwiki-core.css 
file is likely to be a hassle at this point, and I'm not sure it's
worth the hassle.  Even if we provide pmwiki-core.css, skins will 
*still* have to use something to manipulate $HTMLHeaderFmt and/or 
$HTMLStylesFmt, so I'm not sure we're saving anything.  (Either that
or we do some deep magic in analyzing skin templates to decide that
the core styles are already being included by the template.)

Pm




More information about the pmwiki-users mailing list