corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
CSS-INIT..
To use CSS-INIT, you basically need to pipe your css files through the php
engine, which you can do in .htaccess like this..
<FilesMatch "\.(css|style)$">
SetHandler application/x-httpd-php
</FilesMatch>
Once that rule is in your .htaccess, Apache will use php to parse all files
with a ".css" or ".style" extension. Excellent! Now we can have some fun!
Firstly, you will need an array of values to work with, something that
CSS-INIT can use to populate the values inside the style sheets.
By default, that array is named 'site_scheme' (aka $site_scheme), which CSS-
INIT would expect you to have already created and populated, e.g..
$site_scheme:: Array
(
[name] => oranges
[a_active] =>
[a_hover] =>
[a_visited] =>
[alink] =>
[bg_color] =>
[bg_img] => images/Orange-Grad.png
[bg_img_attch] => fixed
[cool_color] =>
etc.
)
The key names corresponding to the %%tokens%% used in your CSS, e.g..
.my-class { color: %%cool_color%%; }
You also need to tell CSS-INIT where to look for modules and snippets. We do
this with a simple array of paths, like so..
$site_config['css_modules_paths'] = array();
$site_config['css_modules_paths'][] = $site_config['root'].'/inc/css/modules';
$site_config['css_modules_paths'][] = $site_config['root'].'/inc/css/snippets';
$site_config['css_modules_paths'][] = $site_config['root'].'/blog/inc/themes/modules';
You can add as many paths as you like (normally there is only two).
By the way, $site_config['root'] is simply my site's variable for
$_SERVER['DOCUMENT_ROOT'], if that wasn't obvious.
Paths are searched IN ORDER, and CSS-INIT uses the first module/snippet it
finds, looks no further, so you can keep global /and/ localized styles, use
modules from other installations, mix-and-match, whatever you like.
CSS-INIT will also expect the $site_config array to have the following two
values (switches)..
$site_config['minify_css'] (boolean)
$site_config['cache_styles'] (boolean)
Obviously you can replace these, indeed the entire $site_config array with
whatever you are using on your site, so long as you set the flags somehow!
If you download a corzblog release, you can see a full implementation of
CSS-INIT (it uses slightly different names for the arrays, so you can see
how easy it is to plug it into some other CMS) with math expressions, scheme
switching, dynamic tokens and *everything*!
For more details, see the accompanying "about this folder.txt" documents
scattered around the place!
En-Joy!!
;o)
(c) 2004->tomorrow! ~ cor + corz.org ;o)
Please view the license for this free software, here:
http: