Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4563

Re: Parsing .css files with php: Cons?

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: Parsing .css files with php: Cons?
Date 2012-01-21 23:14 -0500
Organization A noiseless patient Spider
Message-ID <jfg2eh$6t0$1@dont-email.me> (permalink)
References (7 earlier) <jff3rm$das$1@dont-email.me> <jff8ks$8jc$1@dont-email.me> <agamh75s155va4u0c6p860sfcbpqvi6gsc@mfesser.de> <jffd0o$2qo$1@dont-email.me> <jffo3d$up2$1@dont-email.me>

Show all headers | View raw


On 1/21/2012 8:17 PM, Chuck Anderson wrote:
> Jerry Stuckle wrote:
>> On 1/21/2012 4:22 PM, Michael Fesser wrote:
>>> .oO(Jerry Stuckle)
>>>
>>>> On 1/21/2012 2:31 PM, Chuck Anderson wrote:
>>>>> J.O. Aho wrote:
>>>>>>
>>>>>> I have to say it feels quite much of extra work, writing the php
>>>>>> script which generates the css, as you need to edit the php file,
>>>>>> then
>>>>>> IMHO you can quite easily edit a css instead.
>>>>>
>>>>> I edit one php file and then simply invoke it. There is very little
>>>>> more
>>>>> "work."
>>>>>
>>>>> [...]
>>>>
>>>> I agree with J.O. Seems overly complicated to have to edit a PHP file
>>>> which then generates the CSS. Much easier just to edit the CSS -
>>>> especially when you have syntax-sensitive editors for CSS available.
>>>
>>> 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.
>>>
>>> Micha
>>>
>>
>> Create your .css properly and you don't need to do that.
>>
>
> I use my css generating file, which I would hardly call a script (fopen,
> fwrite, fclose), as a template for whatever miscellaneous project I end
> up working on. I write lots of browser based web apps and this makes for
> a real shortcut, as all I have to do is plug in some basic colors and I
> get a style sheet with all the selectors I'm used to having available in
> whatever color scheme I choose. At any time during or after development
> I can stop using the script and just edit the style sheet directly - but
> as long as I'm fiddling with colors I leave it dynamic.
>
> It seems an unnecessary waste of server resources to keep calling the
> php preprocesssor every time a page loads the .php style sheet. And it
> also seems like using a header of Content-type: text/css for a php file
> is a bit of a kludge.
>
> But, to each their own - and for their own purposes. My method works
> great for my needs.
>

I have a template css file I just edit as required.  Actually, I have 
several, with different options.

When I need a new style sheet, I just pick the closest template to what 
I want, modify it and try it out.  I even keep a copy open in an editor 
on my development system - that way when I want to try something 
different, make a change and save it.  The change is immediately available.

The only thing I use PHP for is to determine which template to load for 
a user if I have different themes available on the website.

And a content-type header is needed for any file that's not html. 
That's just normal operation (in any language).

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Parsing .css files with php: Cons? "J. Frank Parnell" <juglesh@gmail.com> - 2012-01-16 13:36 -0800
  Re: Parsing .css files with php: Cons? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-01-17 11:42 +0100
  Re: Parsing .css files with php: Cons? "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@demogracia.com.invalid> - 2012-01-17 13:31 +0100
  Re: Parsing .css files with php: Cons? Captain Paralytic <paul_lautman@yahoo.com> - 2012-01-17 04:32 -0800
    Re: Parsing .css files with php: Cons? "J. Frank Parnell" <juglesh@gmail.com> - 2012-01-19 12:45 -0800
      Re: Parsing .css files with php: Cons? Captain Paralytic <paul_lautman@yahoo.com> - 2012-01-20 02:07 -0800
        Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-20 11:25 +0100
          Re: Parsing .css files with php: Cons? Captain Paralytic <paul_lautman@yahoo.com> - 2012-01-20 05:33 -0800
            Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-20 15:05 +0100
              Re: Parsing .css files with php: Cons? Chuck Anderson <cycletourist@invalid.invalid> - 2012-01-20 18:50 -0700
                Re: Parsing .css files with php: Cons? "J.O. Aho" <user@example.net> - 2012-01-21 08:10 +0100
                Re: Parsing .css files with php: Cons? Chuck Anderson <cycletourist@invalid.invalid> - 2012-01-21 12:31 -0700
                Re: Parsing .css files with php: Cons? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-21 15:53 -0500
                Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-21 22:22 +0100
                Re: Parsing .css files with php: Cons? "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2012-01-21 21:37 +0000
                Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-22 22:35 +0100
                Re: Parsing .css files with php: Cons? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-22 19:19 -0500
                Re: Parsing .css files with php: Cons? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-21 17:08 -0500
                Re: Parsing .css files with php: Cons? Chuck Anderson <cycletourist@invalid.invalid> - 2012-01-21 18:17 -0700
                Re: Parsing .css files with php: Cons? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-21 23:14 -0500
                Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-22 22:35 +0100
                Re: Parsing .css files with php: Cons? "Peter H. Coffin" <hellsop@ninehells.com> - 2012-01-22 17:14 -0600
                Re: Parsing .css files with php: Cons? Jerry Stuckle <jstucklex@attglobal.net> - 2012-01-22 19:21 -0500
                Re: Parsing .css files with php: Cons? Michael Fesser <netizen@gmx.de> - 2012-01-23 23:44 +0100

csiph-web