Replacing style.css

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Replacing style.css

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Replacing style.css

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Replacing style.css

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Replacing style.css

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Replacing style.css

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Replacing style.css

Post by garvinhicking »

What kind of a messed up build script is that?! :-)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Replacing style.css

Post 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
Post Reply