Page 1 of 1

Replacing style.css

Posted: Mon Apr 23, 2012 2:54 pm
by yellowled
Is there an easy, update-friendly way to make serendipity.css.php not use style.css but any CSS file in the template folder? Maybe by setting a variable in config.inc.php to a regexp? Something like $css_file = css/*.css …?

YL

Re: Replacing style.css

Posted: Mon Apr 23, 2012 3:44 pm
by garvinhicking
Hi!

Why?

If you would not want style.css but another file, why not directly reference that CSS in the HTML head of your template?

Regards,
Garvin

Re: Replacing style.css

Posted: Mon Apr 23, 2012 3:49 pm
by yellowled
garvinhicking wrote:If you would not want style.css but another file, why not directly reference that CSS in the HTML head of your template?
Because that file wouldn't be "concatenated" with the plugin styles. I would like to be able to still use that "combination" mechanism, but I want to use a build script which can not (easily) be tweaked to output a style.css.

YL

Re: Replacing style.css

Posted: Mon Apr 23, 2012 3:57 pm
by garvinhicking
Hi!

I don't think that would be good, both for clarity, configuration option cluttering and clear template development. You should better (manually or automattedly) rename your style.css alternative.

You could also place a symlink from "tool.css" to "style.css" so that everything would work in your development.

Regards,
Garvin

Re: Replacing style.css

Posted: Mon Apr 23, 2012 4:24 pm
by yellowled
garvinhicking wrote:You could also place a symlink from "tool.css" to "style.css" so that everything would work in your development.
Not really a feasible option since the build script will generate a random file name for the stylesheet every time it runs.

Never mind, I just thought I'd ask since sometimes I come up with what I consider to be a great new feature and then you go: "Oh, we already have that." :)

YL

Re: Replacing style.css

Posted: Tue Apr 24, 2012 9:35 pm
by garvinhicking
What kind of a messed up build script is that?! :-)

Re: Replacing style.css

Posted: Tue Apr 24, 2012 11:46 pm
by yellowled
H5BP's. It's actually not messed up at all since it makes cache busting (together with the appropriate settings in .htaccess) much easier. It usually replaces the reference to style.css in HTML files with $RANDOM.css for production use, which saves reloading the page. It even works with CSS references like

Code: Select all

<link rel="stylesheet" href="<?php echo $config->urls->templates?>css/style.css">
(ProcessWire CMS uses those), so it should work with Smarty tpl files as well.

That's not usable in Serendipity templates anyway since we usually pipe all CSS through serendipity.css.php, but the build script also does JS concatenation and minification, removes comments etc., which is why I'd like to use it. But I guess I'll just skip serendipity.css.php altogether then.

YL