HighDots Forums  

Variables?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Variables? in the Cascading Style Sheets forum.



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

Default Variables? - 05-08-2006 , 11:54 AM






Hi,

does anybody know if it's possible to assign variables within css files?

Best Regards,

Oliver


Reply With Quote
  #2  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 11:58 AM






Oliver Block wrote:

Quote:
does anybody know if it's possible to assign variables within css
files?
It is not possible.

--
-bts
-Warning: I brake for lawn deer


Reply With Quote
  #3  
Old   
David Dorward
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 12:22 PM



Oliver Block wrote:
Quote:
does anybody know if it's possible to assign variables within css files?
http://dorward.me.uk/www/css/inheritance/ might be of use.



Reply With Quote
  #4  
Old   
Evertjan.
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 12:34 PM



Beauregard T. Shagnasty wrote on 08 mei 2006 in
comp.infosystems.www.authoring.stylesheets:

Quote:
Oliver Block wrote:

does anybody know if it's possible to assign variables within css
files?

It is not possible.

except serverside.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #5  
Old   
Beauregard T. Shagnasty
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 12:51 PM



Evertjan. wrote:

Quote:
Beauregard T. Shagnasty wrote:

Oliver Block wrote:

does anybody know if it's possible to assign variables within css
files?

It is not possible.

except serverside.
which would be writing a new/different CSS with each page-serve. <g>

--
-bts
-Warning: I brake for lawn deer


Reply With Quote
  #6  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 01:19 PM



On Mon, 08 May 2006 16:51:33 GMT Beauregard T. Shagnasty <a.nony.mous (AT) example (DOT) invalid> wrote:
Quote:
Evertjan. wrote:

Beauregard T. Shagnasty wrote:

Oliver Block wrote:

does anybody know if it's possible to assign variables within css
files?

It is not possible.

except serverside.

which would be writing a new/different CSS with each page-serve. <g
Generate it with PHP. PHP has variables.

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #7  
Old   
Evertjan.
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 01:31 PM



Beauregard T. Shagnasty wrote on 08 mei 2006 in
comp.infosystems.www.authoring.stylesheets:

Quote:
Evertjan. wrote:

Beauregard T. Shagnasty wrote:

Oliver Block wrote:

does anybody know if it's possible to assign variables within css
files?

It is not possible.

except serverside.

which would be writing a new/different CSS with each page-serve. <g

css files are read and "execute" once anyway.
My suggestion means the css-fiel cashing has to be switched off,
so is not very practical.

in-file css however can easily be modified by serverside scripting:

<style>
body {font-size:<%=request.cookies("fontSz") %>pt;}
....

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #8  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 03:29 PM



On Mon, 08 May 2006 17:54:17 +0200 Oliver Block <news200605 (AT) block-online (DOT) eu> wrote:

Quote:
does anybody know if it's possible to assign variables within css files?
Do you want variables that are evaluated once?

CSS appears to be a language that defines the construction of a lookup table
which is (frequently) accessed for property information. If CSS were to
have an ability to assign values to variables and substitute them, it would
likely do so once as the code is parsed and evaluated, and the constants
placed in that lookup table structure.

Do you want variables that are evaluated at every lookup access?

Something would have to change those variables between lookup accesses for
that to have any useful effect. Would this be done in Javascript? What
about a DOM structure for the stylesheet?

Could special relationships be sufficient?

Maybe a value for one property could be based on some aspect of an object
already rendered, or to be rendered, such as specifying the width of one
object to be the same as that of another object, or the width to be twice
its height (say, to set a fixed aspect ratio).

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


Reply With Quote
  #9  
Old   
David Dorward
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 03:41 PM



Beauregard T. Shagnasty wrote:
Quote:
except serverside.

which would be writing a new/different CSS with each page-serve. <g
Only if you fail to send suitable cache control headers.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #10  
Old   
phil-news-nospam@ipal.net
 
Posts: n/a

Default Re: Variables? - 05-08-2006 , 03:58 PM



On Mon, 08 May 2006 20:41:24 +0100 David Dorward <dorward (AT) yahoo (DOT) com> wrote:
Quote:
Beauregard T. Shagnasty wrote:
except serverside.

which would be writing a new/different CSS with each page-serve. <g

Only if you fail to send suitable cache control headers.
I think he means that the content would be different, and that a new CSS
file would have to be sent each time. If variable substitution is done
server-side, you'd have to disable caching, and then you'd have a new CSS
delivered each time, whether same or different. The idea I think he is
wanting to do is have some values in the CSS file be variables that can
be substituted at some point (based one something doing that, I know not
what) so that only one CSS file serves all purposes.

--
-----------------------------------------------------------------------------
Quote:
Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
(first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------


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.