• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 EXTRA.css

Amaury

Well-known member
#1
In vBulletin, if I want to add color to something that isn't controlled by a style variable by default, in additional.css I could do color: white, for example. However, if I later made all the text red, I would have to go back in additional.css and change that accordingly. However, if I do color: {vb:stylevar postbit_color}, then I would not.

Is there a similar function in XenForo with the style properties?
 

MattW

Well-known member
#2
Yeah, you can reference a style property in the CSS with the @ symbol

eg:

Code:
.competitionList .sectionHeaders a
{
    display: block;
    color: @subHeading.color;
    outline: none;
}
Which takes the subHeading group and the colour property
 

Amaury

Well-known member
#3
Yeah, you can reference a style property in the CSS with the @ symbol

eg:

Code:
.competitionList .sectionHeaders a
{
    display: block;
    color: @subHeading.color;
    outline: none;
}
Which takes the subHeading group and the colour property
Thanks!

Question, though: How did you get that? The only place I see the @ symbols is on the color palette. On the individual style properties, I just see, for example, Sub-Heading. Where did you get subHeading.color?
 

MattW

Well-known member
#4
That snippet is from @Chris Deeming 's Competitions add-on.

Have a look in some of the other .css templates via the ACP and you'll see other examples of it being used.

If you hover over the name of the style property in the ACP, it will give you the @ value to use

upload_2014-1-1_6-10-51.png
 

Jeremy

Well-known member
#10
It should yes. I don't actively use style properties myself so I'm not super familiar with what is available, but that is how the system works.