Re: Parsing .css files with php: Cons? [message #176684 is a reply to message #176676] |
Tue, 17 January 2012 12:31 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma:
|
Senior Member |
|
|
El 16/01/2012 22:36, J. Frank Parnell escribió/wrote:
> given: I know about @import and cascading styles, etc etc.
>
> Is is cool to parse .css files with php? Like I may want to include()
> sections into an overall .css. Or i may want to do like color:#<?php
> echo $thecolor; ?>. That kind of stuff.
>
> I guess there might be a little more overhead, but what's a few .css
> files within a whole cms like wordpress? I'm just looking for gotchas
> and unforseen problems.
You might be interested in one of the existing CSS preprocessors, such
as SASS or LESS. It's basically the idea you are describing, except that:
- CSS is generated once (not for every request).
- The code is already written (and not necessarily in PHP).
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|