Re: Parsing .css files with php: Cons? [message #176763 is a reply to message #176750] |
Sun, 22 January 2012 21:35 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(Jerry Stuckle)
> On 1/21/2012 4:22 PM, Michael Fesser wrote:
>>
>> The whole point of using PHP for creating the CSS is to avoid having to
>> edit a dozen places in the CSS to change some color for example. Instead
>> you make use of PHP and variables. Much simpler.
>>
>> And if you still want a "static" CSS for performance reasons, you have
>> to preprocess it. Calling a script for doing this is not much work.
>> Dependent on the used IDE this could even be automated in the build and
>> upload process.
>
> Create your .css properly and you don't need to do that.
A typical short-sighted answer.
Another example: Assuming I want to use different color schemes on
different parts of the website, each with different nuances of the base
color. Of course I could edit the CSS by hand and calculate all needed
values by myself - a background color here, a border color there, some
text colors and others -, but I could also let PHP do the work: I just
define the base color and all others are calculated automatically.
And there are many other situations where some programming or
conditional logic in the CSS might come in handy, which has absolutely
nothing to do with your "properly created" CSS.
The only question - and what this sub-thread is all about - is whether
you want to have the CSS script parsed everytime or if you want to cache
the result. The latter is what Chuck does by calling his generator
script.
Micha
--
http://mfesser.de/blickwinkel
|
|
|