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

As Designed Cannot reference certain style properties

Discussion in 'Resolved Bug Reports' started by Mike Creuzer, Apr 17, 2014.

  1. Mike Creuzer

    Mike Creuzer Well-Known Member

    Not sure if this is intentional or not.

    Trying to reference some variables, such as @body.background-color works fine. But @body.background-image does not work, nor does background-repeat, background-position, and probably others.
     
    Amaury, Enguerran A and Adam Howard like this.
  2. CyberAP

    CyberAP Well-Known Member

    As I recall this was possible to do in XF 1.0 and 1.1.
     
    Adam Howard likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    This is removed intentionally (compileCssProperty_cleanUp method in the style property model), mostly to reduce memory usage (as the style property cache is already fairly large and people often have multiple styles. Properties that we considered unlikely to be used independently are not exposed to the cache.

    This was not possible in 1.1 (I didn't check 1.0 though).
     
    Amaury likes this.
  4. Mike Creuzer

    Mike Creuzer Well-Known Member

    Thanks for the answer. Not the right place to ask, perhaps, but is the CSS cached or are the variables themselves? I thought it was the CSS that was recached everytime you save the template. If so, couldn't you reference as many variables as you wanted? Just curious.
     
  5. Mike

    Mike XenForo Developer Staff Member

    The property values are not cached in the CSS. (They are a template syntax so they are resolved live as needed.)
     
  6. Mike Creuzer

    Mike Creuzer Well-Known Member

    Would it make sense to do so? I thought on template save, it takes that code, parses all the xenforo syntax, and outputs raw html/css which is then cached. The cached file is whats served. Updating a template updates the cache. Is that not accurate? It would seem then that all the caching is done in the backend so you could then use how many variables you wanted.

    I by no means understand how this process works, just trying to so I am curious. Sorry if this doesn't make sense.
     
    Adam Howard likes this.

Share This Page