• 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

Zephyr

Well-known member
#1
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.



And I have a big duplicate css code:



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.