HighDots Forums  

Will CSS ever be programmable?

Websites/HTML pages critique & reviews Discuss and review existing WWW material (alt.html.critique)


Discuss Will CSS ever be programmable? in the Websites/HTML pages critique & reviews forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TreatmentPlant
 
Posts: n/a

Default Will CSS ever be programmable? - 07-14-2006 , 02:34 AM






Do you think CSS will ever get to the stage where we can use variables
and pro grammatically set values, like:

colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid colour1}

etc

???

Reply With Quote
  #2  
Old   
Chris F.A. Johnson
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 03:11 AM






On 2006-07-14, TreatmentPlant wrote:
Quote:
Do you think CSS will ever get to the stage where we can use variables
and pro grammatically set values, like:

colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid colour1}
Something like this, perhaps:

<http://cfaj.freeshell.org/www/prgcss.shtml/blue/yellow>
<http://cfaj.freeshell.org/www/prgcss.shtml/black/red>

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)


Reply With Quote
  #3  
Old   
Paul Watt
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 05:40 AM






"Chris F.A. Johnson" <cfajohnson (AT) gmail (DOT) com> wrote

Quote:
On 2006-07-14, TreatmentPlant wrote:
Do you think CSS will ever get to the stage where we can use variables
and pro grammatically set values, like:

colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid
colour1}

Something like this, perhaps:

http://cfaj.freeshell.org/www/prgcss.shtml/blue/yellow
http://cfaj.freeshell.org/www/prgcss.shtml/black/red

What would be the point? You would be just adding a line of unessacary code

--
Cheers

Paul
le singe est dans l'arbre
http://www.paulwatt.info




Reply With Quote
  #4  
Old   
TreatmentPlant
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 07:12 AM



Paul Watt wrote:
Quote:
"Chris F.A. Johnson" <cfajohnson (AT) gmail (DOT) com> wrote in message
news:f70ko3-dgm.ln1 (AT) xword (DOT) teksavvy.com...
On 2006-07-14, TreatmentPlant wrote:
Do you think CSS will ever get to the stage where we can use variables
and pro grammatically set values, like:

colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid
colour1}
Something like this, perhaps:

http://cfaj.freeshell.org/www/prgcss.shtml/blue/yellow
http://cfaj.freeshell.org/www/prgcss.shtml/black/red


What would be the point? You would be just adding a line of unessacary code

I will extend the example to make it more apparent:


colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid colour1}
h1 {background-color:colour2; color:colour3;}
h2 {background-color:colour3; color:colour1;}
etc

....you could change the entire site colour scheme more easily.
....it would save you minutes!



Reply With Quote
  #5  
Old   
Spartanicus
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 08:57 AM



TreatmentPlant <treatmentplant (AT) DIESPAMMERS (DOT) iinet.net.au> wrote:

Quote:
colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid colour1}
h1 {background-color:colour2; color:colour3;}
h2 {background-color:colour3; color:colour1;}
etc

...you could change the entire site colour scheme more easily.
...it would save you minutes!
Any decent editor has a S&R feature

Search: color:blue
Replace: color:red

Only takes a few seconds

Btw, this is off topic in alt.html.critique, crossposted and follow-up
set to alt.html

--
Spartanicus


Reply With Quote
  #6  
Old   
JDS
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 09:07 AM



On Fri, 14 Jul 2006 20:12:28 +0800, TreatmentPlant wrote:

Quote:
I will extend the example to make it more apparent:


colour1:=red;
colour2:=blue;
colour3:=white;

body {background-color:colour3; color:colour2; border: thin solid colour1}
h1 {background-color:colour2; color:colour3;}
h2 {background-color:colour3; color:colour1;}
etc

...you could change the entire site colour scheme more easily.
...it would save you minutes!
This can already be done using a combination of server-side programming
and CSS. Say, PHP, perhaps?

example CSS file, "site.css.php":
---------------------------------
<?
header("Content-type: text/css");
$color1="red";
$color2="blue";
?>
p {
background-color: <?= $color1 ?>;
color: <?= $color2 ?>;
}
---------------------------------


Just an example.
--
JDS



Reply With Quote
  #7  
Old   
Spartanicus
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 09:10 AM



JDS <jeffrey (AT) invalid (DOT) address> wrote:

Quote:
example CSS file, "site.css.php":
---------------------------------
?
header("Content-type: text/css");
$color1="red";
$color2="blue";
?
p {
background-color: <?= $color1 ?>;
color: <?= $color2 ?>;
}
---------------------------------
Wouldn't that cause the stylesheet to be retrieved from the server again
and again for every page?

--
Spartanicus


Reply With Quote
  #8  
Old   
JDS
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 03:01 PM



On Fri, 14 Jul 2006 14:10:01 +0000, Spartanicus wrote:

Quote:
Wouldn't that cause the stylesheet to be retrieved from the server again
and again for every page?
come again? How would that happen?

All you have to do to use my proposed CSS+PHP stylesheet is call it
normally in the header:

<LINK href="style.css.php" rel="stylesheet" type="text/css">

--
JDS



Reply With Quote
  #9  
Old   
Spartanicus
 
Posts: n/a

Default Re: Will CSS ever be programmable? - 07-14-2006 , 05:15 PM



JDS <jeffrey (AT) invalid (DOT) address> wrote:

Quote:
Wouldn't that cause the stylesheet to be retrieved from the server again
and again for every page?

come again? How would that happen?
Without counter measures the stylesheet would be generated by PHP each
time it is called, generating a different file timestamp, thereby
thwarting cachebility.

--
Spartanicus


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.