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

Lack of Interest Loop in css

Discussion in 'Closed Suggestions' started by Zephyr, Apr 26, 2013.

  1. Zephyr

    Zephyr Well-Known Member

    Hello, it would be cool to make loops in the css code.

    Example:

    HTML:
    for( nodeID in xenOptions.nodeList, nodeColor in xenOptions.nodeListColor )
    {
        .node{nodeID} .header {
            background: rgb({nodeColor});
        }
    }
    This idea came to me with my style called Color.
    The colors of the categories and subforums are defined by the nodeID.

    [​IMG]

    And I have a big duplicate css code:

    [​IMG]

    HTML:
    .node{$xenOptions.4You_catId_1} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_1}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_2} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_2}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_3} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_3}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_4} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_4}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_5} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_5}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_6} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_6}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_7} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_7}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_8} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_8}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_9} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_9}, 0.1) !important;
    }
    .node{$xenOptions.4You_catId_10} .messageUserInfo
    {
        background-color: rgba({$xenOptions.4You_color_10}, 0.1) !important;
    }
    
    AND MORE FOR ALL PROPERTIES...

    The performance is not annoying with the system level cache, it loads very quickly by con, any change is a nightmare, a system of loop/array in css template would solve the problem and extand possibility for devellopers.
     
  2. tyteen4a03

    tyteen4a03 Well-Known Member

    You probably want to create a full-fledged addon to generate all the CSS in PHP code. Your current design is not flexible.
     

Share This Page