Reply to Re: CSS: Any way to use variables or constants?

Your name:

Reply:


Posted by Curtis on 11/14/00 11:36

Mark Parnell <webmaster@clarkecomputers.com.au> wrote in
message
news:43bc80ba$0$15743$5a62ac22@per-qv1-newsreader-01.iinet.n
et.au...
> Deciding to do something for the good of humanity, Curtis
> <nospam@nohow.not> spouted in alt.html:
>
> > 1. Are there existing CSS techniques whch would allow
> > something like this, at least in part?
>
> You can specify multiple things at once, e.g.
>
> .header, .left_sidebar
> {
> background-color: #059FBA;
> }

Sure, I've been doing a bit of that. Might be handy to move
the "globals" to the top as a section, then alphabetize all
the selectors (including the expanded versions of .header,
etc.) below.


> > 2. If not, is it theoretically possible to generate CSS
> > sheets with PHP, which would allow the declaration and
use
> > of constants and functions?
>
> Absolutely, as long as it sends the correct mime type
(text/css). E.g.
>
> <?php
> header("Content-Type: text/css");
> $masterColour = "#F830C2";
> ?>
>
> * {background-color: <?php print($masterColour); ?>;}
>
> etc.

In the markup language we're writing, we've created a macro
feature--creating styles for the page elements is one of the
things it currently does, using reserved class words. It
should not be too difficult (time-consuming, perhaps) to
pass some selected PHP features through to allow computed
variables such as the color thing I was describing--assuming
we're not suffering from a case of featuritis.

But the notion of 'computed CSS sheets' wholesale for
theme/template/skins has a certain appeal. Anyone know of
who might be doing this already, as opposed to using PHP to
gen the HTML page which in turn calls an ordinary CSS?

Perhaps some "engine" or "framework" I'm not aware of?

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация