Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: Parsing .css files with php: Cons? Date: Sat, 21 Jan 2012 08:10:28 +0100 Lines: 36 Message-ID: <9nv6n4F6anU1@mid.individual.net> References: <400f69e3-9555-4cc0-b529-6dbca54d9bfa@k3g2000pbn.googlegroups.com> <83gih757lb1shbfamuk67juagcmftmiu0d@mfesser.de> <65ce085f-7e7d-4ae3-af69-f96370944eac@m11g2000yqe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net fE1wdkcdcyJCMEorIZj+yw40J0ctWY4BWBMCNp6H1w8zONC0pR Cancel-Lock: sha1:i4bT9iy53n8ZBVGhQeiZeouHt9E= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0.1) Gecko/20111226 Firefox/9.0.1 SeaMonkey/2.6.1 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4554 Chuck Anderson wrote: > Michael Fesser wrote: >> .oO(Captain Paralytic) >> >>> On Jan 20, 10:25 am, Michael Fesser wrote: >>>> No. You have to explicitly send the correct header or some browsers >>>> might ignore the CSS. For example >>>> >>>> header('Content-Type: text/css; charset=UTF-8') >>> Oh OK. Any ideas which ones? >> >> In the past Gecko browsers (i.e. Firefox) were a bit picky about the >> correct CSS content type. If the file wasn't delivered as text/css, it >> was ignored. >> > I have successfully used: > header("Content-type: text/css"); > > After implementing a php based style sheet a couple of different times it > seemed wasteful, and a bit of a kludge. If the style sheet is ultimately > static, it is wasteful to keep generating one every time it is used. Now I use > a php script to generate the style sheet file for me. If I want to make > changes I edit the php based file (or any included definition files, e.g., > colors.php) and run it. > 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 could see a bit more point of your script if you have a database as a backend, where you store the values and recreate the css each time the values change. -- //Aho