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

Define Style Properties within templates based on other style properties

Discussion in 'XenForo Development Discussions' started by Erik, Nov 20, 2010.

  1. Erik

    Erik Well-Known Member

    Basically, what I am trying to do is create the ability to allow users of my theme to select a simple color choice (Red, Orange, Blue, Green, etc.) which will then color the entire theme without needing to adjust the color palette manually or even use the hue slider.

    Is there a way to set or define Style Properties within the templates? For example, I want to do something like:
    <xen:if is="@myStyleProperty">
    <xen:set @primaryMedium="rgb(0,50,0)" />
    <xen:set @primaryLighter="rgb(0,100,0)" />
    Is there any way to do this? As I mentioned above, the end goal is to allow theme users to be able to pick preset colors of the theme through Style Properties, or choose a "custom" color and adjust the color pallet directly. :)
    CyberAP and Jamie like this.
  2. Mike

    Mike XenForo Developer Staff Member

    No, that's not possible. In theory, you could probably do something like that with an addon.

    You're probably better off creating child styles that customize only the color properties (or whatever properties you want), and have people install them as children of the base style.
  3. Floris

    Floris Guest

    Kinda the purse of it being a 'child' style, ;)
  4. Erik

    Erik Well-Known Member

    Ok, thanks for the response Mike. :)

Share This Page