1
Peekay
Variables in CSS?
  • 2005/6/2 11:40

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I would like to be able to define a colour value and assign it to a variable, for example:

colour1 = #ccc999

Then, in the theme stylesheet, I could use the VAR instead of defining colours, for example:
td#centrecolumn th {
background-color: [colour1];
}

AFAIK this can't be done using CSS, but I wondered if anyone knows of an application that would let me build stylesheets like that then export the CCS file?

2
Herko
Re: Variables in CSS?
  • 2005/6/2 11:44

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


No, there is no interpreteer vor variables in css files afaik. What you could do tho is turn it around:

instead of making the css variable, make the class call variable: < td class="centercolumn<{variable}>">
and define in your css file the
td#centercolumOne {}
td#centercolumTwo {}
td#centercolumThree {}
td#centercolumFour {}
td#centercolumFive {}
etc.

That way you can have variable styles, depending on a var you give for this

Herko

3
Peekay
Re: Variables in CSS?
  • 2005/6/2 12:02

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Oooooh!... nice idea! Thx Herko. I'll have a play with that.

Login

Who's Online

235 user(s) are online (179 user(s) are browsing Support Forums)


Members: 0


Guests: 235


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits