Code Comments
Programming Forum and web based access to our favorite programming groups.appplehead2000@yahoo.co.uk wrote: > is it possible to control css with php > Sure. CSS can be generated with PHP, just like HTML can. The main question being - why? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
Post Follow-up to this message..oO(Jerry Stuckle) >appplehead2000@yahoo.co.uk wrote: > >Sure. CSS can be generated with PHP, just like HTML can. > >The main question being - why? I do it for one reason - CSS doesn't support variables. With PHP I can define some variables or constants at the beginning and then simply use them later. Makes it very easy to play with different values. And with some proper HTTP headers at the beginning the PHP-CSS is still cacheable in browsers. Micha
Post Follow-up to this messageOn Fri, 14 Mar 2008 13:04:24 +0100, Michael Fesser <netizen@gmx.de> wrote: > .oO(Jerry Stuckle) > > I do it for one reason - CSS doesn't support variables. With PHP I can > define some variables or constants at the beginning and then simply use > them later. Makes it very easy to play with different values. > > And with some proper HTTP headers at the beginning the PHP-CSS is still > cacheable in browsers. Indeed. Do provide the correct content-type and some caching headers :). -- Rik Wasmus
Post Follow-up to this messageMichael Fesser wrote: > .oO(Jerry Stuckle) > > > I do it for one reason - CSS doesn't support variables. With PHP I can > define some variables or constants at the beginning and then simply use > them later. Makes it very easy to play with different values. > > And with some proper HTTP headers at the beginning the PHP-CSS is still > cacheable in browsers. > > Micha > Hi, Micha, Yes, that I can understand, and I've done similar in the past. But once I get something I like, I typically just convert it to CSS and let it go at that. But that also isn't "controlling" CSS like I think the op wants to do. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
Post Follow-up to this messageJerry Stuckle wrote: > Michael Fesser wrote: > > Hi, Micha, > > Yes, that I can understand, and I've done similar in the past. But once > I get something I like, I typically just convert it to CSS and let it go > at that. > > But that also isn't "controlling" CSS like I think the op wants to do. > Does he mean - say - linking to a stylesheet that is in fact a php script?
Post Follow-up to this messageThe Natural Philosopher wrote: > Jerry Stuckle wrote: > Does he mean - say - linking to a stylesheet that is in fact a php script? > > Yes. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
Post Follow-up to this messageyou can pass arguments to the PHP script and generate different CSS
Post Follow-up to this messageGreetings, Jerry Stuckle. In reply to Your message dated Friday, March 14, 2008, 05:24:43, > Sure. CSS can be generated with PHP, just like HTML can. > The main question being - why? In example, You have 3 browsers (Regular desktop, Mobile client (GPRS-WAP an d the like), specialized in-application browser) what should render the same page without loosing of readability. Yes, You can send different CSS for eve ry single one, but maintaining 3 different files isn't easy, if they are so close and You need to make changes in them all if something goes to change. Much simpler to have PHP script that acting to serve CSS template and adapt it to every browser. Even then, with server-side caching it's very fast process , and with proper headers it will be cached on the client side too. -- Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>
Post Follow-up to this messageAnrDaemon wrote: > Greetings, Jerry Stuckle. > In reply to Your message dated Friday, March 14, 2008, 05:24:43, > > > > > In example, You have 3 browsers (Regular desktop, Mobile client (GPRS-WAP and > the like), specialized in-application browser) what should render the same > page without loosing of readability. Yes, You can send different CSS for e very > single one, but maintaining 3 different files isn't easy, if they are so > close and You need to make changes in them all if something goes to change . > Much simpler to have PHP script that acting to serve CSS template and adap t it > to every browser. Even then, with server-side caching it's very fast proce ss, > and with proper headers it will be cached on the client side too. > > And even simpler is to have valid CSS which works in all browsers. Then you don't need hacks like you are promoting. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.