1. 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

Discussion in 'Resolved Bug Reports' started by silence, Dec 11, 2014.

  1. silence

    silence Well-Known Member

    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:
    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 :(

  2. Brogan

    Brogan XenForo Moderator Staff Member

    The only time you should edit the master style is when you create an add-on.
  3. silence

    silence Well-Known Member

    Yeah I'm doing that :)
    I want to provide styling for users with UI.X and the only way to identify that style is to use a style property.
  4. Mike

    Mike XenForo Developer Staff Member

    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 likes this.
  5. silence

    silence Well-Known Member

    Is there any way currently to target specific styles then?
  6. Brogan

    Brogan XenForo Moderator Staff Member

    The new avatar completely threw me.

    I'm obviously not flavour of the month anymore, unlike that toast...
    tyteen4a03, Amaury and silence like this.
  7. Mike

    Mike XenForo Developer Staff Member

    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:
    {xen:property propertyName}
    If you use the direct syntax, it should work (though note that invalid style property access may trigger an error).
    silence likes this.

Share This Page