[pmwiki-users] New skin: Pukka Float

Bronwyn Boltwood arndis at gmail.com
Thu Mar 17 12:40:10 CST 2005


On Thu, 17 Mar 2005 14:50:39 +0000, Hans <design at flutesong.net> wrote:

[from the previous mail]
> In the template call various css files to import by using varables,
> and define values for the variables in skin.php.

That's not as flexible an approach as the stitch_foo files.  The
current approach allows an admin to add *any* custom css, even if it
doesn't fit into my categories, with less work than in the variables
approach.  Plus, it won't perform as well (as I'll explain a bit more
below).

> I could not get the Pukka Float working out of the zip,
> got the same results than on pmwiki.org. The reason must lie
> in how you try to highjack the css files as php files with the
> .htaccess trick. Somehow this trick does not work here.

The weird thing is that I included the .htaccess file in the zip, and
that the page describing the method didn't say anything at all about
different versions of Apache or PHP doing different things.  They
*did* say that it hasn't been tested extensively though...  The
stitching trick is borrowed from
http://www.fiftyfoureleven.com/sandbox/weblog/2004/aug/css-php-organized-optimized/.

For what it's worth, my local testbed uses Apache 1.3.33 and PHP
4.3.10, straight from the WAMPserver bundle/add-ons
(http://www.wampserver.com/en/index.php).

I'm going to have real trouble resolving this problem because 
1. it works as expected on my local testbed
2. it has a different error on my real webserver than you folks do!
3. I don't know any PHP, so I can't write a skin.php to replace the
.htaccess trick.

Deity forbid, I might have to call the individual CSS files from the
template, which would suck because it'll lower performance, and makes
the skin more annoying to configure.  Argh!  I was *so* happy about
this cool thing that I accomplished!

> Now your intention was to "stitch" various css files together.
> I played around trying to achieve this using a skin.php file
> (contents below). I got the skin working with this file, by not using
> the stitch-*.css files and not using the .htacess file.
> The main restriction with this skin.php is a loss of discrimination of
> a linked and an imported css file in the template. 

That is a really important change, because it breaks the automatic
switching from lo-fi to hi-fi mode, so old or mobile browsers will
probably see a broken mess.  Stitch_imported.css uses the exact import
syntax that it does to hide the advanced CSS from browsers that can't
support it, based on my testing.

I have no objection to using a single skin.php to configure the skin,
but I won't accept one that breaks the cross-browser compatibility
that I worked so hard to achieve!

Unfortunately I don't know how to write PHP, so I can't write a
skin.php that does what I want.  Clearly I ought to give in and learn
PHP, but I need to get a job first...

> makes for  all the style code appearing in the html header. It would
> have been nice to write it all to a new css file (or two: one for
> linking, and one for @import), but I failed to find a way to get
> permission to write this file.

If someone could write a skin.php that made two CSS files and called
them in the correct manner for each, then the skin should work as
intended, and would perform better than your current skin.php.
 
> Anyway it works. The question I am asking myself now is: Does it
> speed page loading up if there are less css file modules to load, or
> does it slow down because $HTMLStylesFmt needs to be constructed with
> all the styles for each page. My experience with using a few
> stylesheets to load (in Gemini) is that the browser starts caching the
> css files and the page loading goes quick then.

Yes and yes.  Pages load faster when there are fewer file requests. 
But, pages also load faster when they use .css files instead of
embedded styles, because the .css file can be cached, instead of
wasting bandwidth on exactly the same embedded styles for every page. 
So, performance-wise, the ideal situation is to link or import as few
stylesheets as possible.  But, for ease of developing and customizing,
many small .css files can be more convenient.  I was trying to have
the best of both worlds by using someone else's trick.

I am not certain what the best method is to tackle this problem.  Does
anybody have ideas?  Especially if they know more about .htaccess
files and writing PHP than I do?

Bronwyn



More information about the pmwiki-users mailing list