#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Location
    Belfast
    Posts
    78
    Rep Power
    12

    Constants in CSS?


    Hello Readers One and All
    (and Seasons Greetings too...)

    Is it possible to define constants in a CSS so for example each time I use

    color = 'Grey';

    It inserts #D6D7DE? I appreciate there are already defaults (and Grey is probably one of them. This isn't about overwriting those defaults, but about adding my own...

    Any information appreciated

    Thanks

    Tyndyll
  2. #2
  3. |<.+#f@#+.&.|
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2002
    Location
    norway
    Posts
    3,009
    Rep Power
    1224
    no, there is no way to do that.
  4. #3
  5. HTML/CSS/Photoshop maven
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    CA
    Posts
    184
    Rep Power
    12
    You'd have to use some fancy code to accomplish that, like storing your value in a variable in PHP, Perl, Javascript, etc.

    BTW: That's why they call them constants.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Location
    Belfast
    Posts
    78
    Rep Power
    12
    Cheers for the info - could set it up in PHP but probably more effort than its worth. The design department are still playing with the shades to make it look all pretty so it would have been handy just to change the constant in one place....

    As an aside I think TopStyle has an option like this (from memory) but just wanted to check it out for academia's sake
  8. #5
  9. HTML/CSS/Photoshop maven
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    CA
    Posts
    184
    Rep Power
    12
    Yes, it would need a good bit of PHP coding to get it to interpret "gray" as a # value you set.

    To congregate all the tags you'd need as gray into one spot, define them all at the same time, like:

    a, h1, etc. {color: gray}

IMN logo majestic logo threadwatch logo seochat tools logo