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

As designed Master Style Style Properties

silence

Well-known member
#1
Here's how to duplicate it:

So let's say my style setup is as followed:
Master Style
-> Default Style
-> Custom Style

I create a CSS template within Master Style and include the style property:
Code:
@testProperty
Now, I don't have a style property of that name defined within Master Style, but I do within Custom Style.
If I use Custom Style, the style property is still undefined.

The only way to get around this is to edit a template in Custom Style and use that style property to get access to it.

Is this by design or a bug? I want to be able to provide style-specific features to users and this makes it difficult :(

Thanks!
 

Mike

XenForo developer
Staff member
#4
Attempting to use a style specific property in a location where the property doesn't (or may not) exist isn't a use case we're targeting. That said, I'd have to look a little more detail to see what's going on exactly.
 

silence

Well-known member
#5
Attempting to use a style specific property in a location where the property doesn't (or may not) exist isn't a use case we're targeting. That said, I'd have to look a little more detail to see what's going on exactly.
Is there any way currently to target specific styles then?
 

Mike

XenForo developer
Staff member
#7
Right, this is as designed roughly as explained above.

The reason the property doesn't appear to work is because @propertyName is a short hand for what is assumed to be a valid property. If the property doesn't exist (in the style you're in), it doesn't get converted to the actual syntax, which is:
Code:
{xen:property propertyName}
If you use the direct syntax, it should work (though note that invalid style property access may trigger an error).