colors - Is it possible to have a level of indirection in css? -


what have ties placeholder name color can substitute entire color palette without having change css individual elements. there many placeholders same color level of indirection when want try palette or individual color have change master, i.e. placeholders not have change when palette changes.

// pseudocode example of level of indirection: // master color pallet blue: dodgerblue  /* actual css element placeholder color */ .openbutton {     background: blue; /* displays dodgerblue */  }   // changing palette blue: skyblue  .openbutton {     background: blue; /* displays skyblue */  } 

i should mention i'm doing following requires color treated class not quite indirection i'm looking for.

 .blue{       color:dodgerblue; } 

that's not possible css (check out less).

i recomend @ start of project, specially if big, have css sheet (as call it) common properties. 1 of common properties add in sheet are, among others, colors (for text , background) going used in project (corporative colors).

for example:

.txt-color-light {color:#xxxxxx;} .txt-color {color:#xxxxxx;} .txt-color-dark {color:#xxxxxx;} .bck-color-light {background-color:#xxxxxx;} .bck-color {background-color:#xxxxxx;} .bck-color-dark {background-color:#xxxxxx;} 

from never have add colors on element class (except uncommon , unique elements) add class in html when needed. @ first may confusing once got use it, became faster, less css lines, , anytime need change color in project have change 1 line.

my 2 cents.-


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -