// Provides mixin to generate colors for cells backgrounds // @function merge-color($color-1, $color-2) { $col2: rgb(red($color-2), green($color-2), blue($color-2)); $percent: 100*alpha($color-2); @return mix($col2, $color-1, $percent); } @function merge-colors($color, $color-1: rgba(0, 0, 0, 0), $color-2: rgba(0, 0, 0, 0), $color-3: rgba(0, 0, 0, 0), $color-4: rgba(0, 0, 0, 0), $color-5: rgba(0, 0, 0, 0), $color-6: rgba(0, 0, 0, 0), $color-7: rgba(0, 0, 0, 0), $color-8: rgba(0, 0, 0, 0), $color-9: rgba(0, 0, 0, 0), $color-10: rgba(0, 0, 0, 0)) { @return merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color(merge-color($color, $color-1), $color-2), $color-3), $color-4), $color-5), $color-6), $color-7), $color-8), $color-9), $color-10); } $list-line-backgrounds: ("&" rgba(#FFF, 0)) ("&.error, &.undone" rgba(red, 0.12)) ("&.warning, &.in_progress" rgba(orange, 0.12)); $list-column-backgrounds: ("&" rgba(#FFF, 0)) ("&.act" rgba(#F90, 0.01)) ("&.sor" rgba(#05A, 0.05)); $list-hover-backgrounds: ("&" rgba(#FFF, 0)) ("&:hover" rgba(blue, 0.05)); @mixin list-colors($bgcolor: #000000, $selector: '&') { tr { #{$selector} { @each $line-background in $list-line-backgrounds { #{nth($line-background, 1)} { @each $hover-background in $list-hover-backgrounds { #{nth($hover-background, 1)} { @each $col-background in $list-column-backgrounds { td { #{nth($col-background, 1)} { background-color: merge-colors($bgcolor, nth($line-background, 2), nth($col-background, 2), nth($hover-background, 2)); } } } } } } } } } }