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

Patrick R. Michaud pmichaud at pobox.com
Mon Oct 30 12:52:14 CST 2006


On Mon, Oct 30, 2006 at 06:35:20PM +0000, Hans wrote:
> Monday, October 30, 2006, 4:06:05 PM, Patrick wrote:
> 
> > 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.
> 
> With this second option I do not see that it is up to the skin.php to
> load a pmwiki-core.css file. It could just as well be loaded from
> pmwiki.php with a $HTMLHeaderFmt['pmwiki-core'] definition. This will
> load at the beginning of HTMlHeader, leaving admin/local
> customisations etc to override styles if needed. A skin can still load
> a css file later.

... but then how does the admin override the skin's customizations?

> > 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.
> 
> I understand. But a pmwiki upgrade will just add the new
> pmwiki-core.css file, load it, and not use any more HTMLStylesFmt
> definitions to add the core styles from pmwiki.php and some scripts.
> It does not need a universal change in all skins.

If you're saying to eliminate the current $HTMLStylesFmt settings
that set the core styles, then this will break any existing skins 
that depend on a statement like

    $HTMLStylesFmt['pmwiki'] = '';

to eliminate the core styles.

> > 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.)
> 
> I don't see that that is necessary, merely optional for a skin
> designer. But maybe I overlooked something fundamental here?

If I understood correctly, your proposal was that a skin designer
would use the following in a template file:

    <link rel='stylesheet' href='$FarmPubDirUrl/css/pmwiki-core.css' type='text/css' />
    <link rel='stylesheet' href='$SkinDirUrl/skin.css' type='text/css' />
    <!--HTMLHeaderFmt-->

But if PmWiki is setting $HTMLHeaderFmt['pmwiki-core'] by default, 
then it's also necessary for the skin.php file to unset that value 
in order to avoid having pmwiki-core.css load a second time
(and after the skin.css).  So, the skin designer still has to
manipulate $HTMLHeaderFmt in order to make things work properly.

Pm




More information about the pmwiki-users mailing list