[pmwiki-users] New skin: Pukka Float

Bronwyn Boltwood arndis at gmail.com
Thu Mar 17 02:33:19 CST 2005


On Wed, 16 Mar 2005 10:49:28 -0600, Patrick R. Michaud
<pmichaud at pobox.com> wrote:
> On Wed, Mar 16, 2005 at 02:43:04AM -0500, Bronwyn Boltwood wrote:
> > I've just posted a new skin called Pukka Float.  Details at
> > http://www.pmwiki.org/wiki/Cookbook/PukkaFloat.
> > [...]
> > Pm, I have a couple requests for you:
> > 1.  Could you set up the demo?  Thanks in advance.
> 
> Done, but it doesn't seem to be working on pmwiki.org for some reason.
> I've left it enabled, but probably don't have time to troubleshoot it at
> the moment.

I can help a little with that. :)  Firefox's webdev edit css sidebar
tells me that it is getting the correct contents for stitch_linked.css
and stitch_imported.css, but I bet it's not doing the right thing
after that.  This skin relies on a trick: the css dir contains a
.htaccess that tells it to handle css files with PHP:
	AddHandler application/x-httpd-php .css
	php_value default_mimetype "text/css"
The stitch_foo.css files called from the .tmpl file are actually PHP
files that have many lines like this:
	include("function-foo.css");
Most of which are commented out. What this *should* do is to string
together the proper CSS files into one, and hand it to the browser. 
It's working nicely on my local testbed, and is almost as good a
solution for easy configuration as the wikipage idea that I pursued
originally.

Did the .htaccess get left out or changed, or anything else happen to
prevent PHP from parsing the stitch_foo.css files?

I tried to reproduce the problem on my real webserver.  It doesn't
like this skin either, but I think it's a different problem: it's
giving back a 500 Internal Server Error instead of the stitched
stylesheets.  I wish I knew what to do about that...

> Also, it'd be nice if the zip file automatically unpacked into its own
> subdirectory (e.g. pukkafloat/) instead of into the current directory.
> This is how most of the other skin zip files appear to be set up.

Now fixed and uploaded.
 
> > 2.  Is there anything that can be done about the $action selector
> > needing to be in the .tmpl file to work?
> 
> I'm not sure -- because this skin has so many .css files, I'm having
> a bit of trouble knowing what ties to what.  (I confess I haven't
> spent a whole lot of time looking yet.)  

The rules with $action in them are from the appropriate
colour-foo.css, and have to be copied into the .tmpl file.

> But it's pretty certain that
> the $action selection has to be made from something running within
> pmwiki.php (since that is what knows the action), and the template
> is pretty much the piece that pmwiki.php works with.  You could
> potentially do some creative css imports in the .tmpl file, as in:
> 
>    @import '$SkinDirUrl/css/navigation-$action.css';
> 
> which would at least move the relevant rules into .css files and out of
> the template.

I'm using 

    #cmdtabs a:hover, #cmdtabs a:focus, #cmdtabs a#$action { /* copy
this rule to the .tmpl file! */
    	border-bottom:6px solid;
    	}
    #cmdtabs a#$action { /* copy this rule to the .tmpl file! */
    	border-color:#999;
    	background:#f5f2e8;
    	}

To apply colours and borders to the tab for the current action.  I
can't see how @import '$SkinDirUrl/css/navigation-$action.css'; will
further my goal of letting the admin switch from a pink colour scheme
to a blue one by changing
	include("colour-pink.css");
	#include("colour-blue.css");
To 
	#include("colour-pink.css");
	include("colour-blue.css");

I know what @import '$SkinDirUrl/css/navigation-$action.css'; would
work beautifully for: negating my bargaining chip! ;)

See, people have wanted a way to turn off the sidebar while in edit
mode on CSS-based skins.  This is that way.  Create a css file called
mode-edit.css.  Use @import '$SkinDirUrl/css/mode-$action.css'; in the
.tmpl file to call it when, and only when, we're in an edit page.  In
mode-edit.css, we have something like:
	#sidebar {
		display:none;
		<appropriate margins etc. for single-column layout>
		}
There are all kinds of custom styling goodies that could be applied to
specific actions in this way, and if you wanted to apply the same ones
to multiple actions, that's what group selectors and the @import rule
are for.

You've just made my mind boggle at what could be accomplished with
this beautiful little trick.

Unfortunately, my stupid little colour-scheme switching problem above
is not solved by this. The method I can think of is to have something
look for $action while reading the CSS files, and substitute PmWiki's
current action.  Now, given that this skin is already preprocessing
the stylesheets with PHP, what can we do?

Bronwyn



More information about the pmwiki-users mailing list