Sha256: dc9f07e1c5da24cbc7efae399a592aef9217716ba436ec1fabe65a62b1342f25

Contents?: true

Size: 1.7 KB

Versions: 4

Compression:

Stored size: 1.7 KB

Contents

// 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));
		  }
		}
              }
            }
          }
        }
      }
    }
  }
}

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
active_list-6.0.1 app/assets/stylesheets/active_list/background.scss
active_list-6.0.0 app/assets/stylesheets/active_list/background.scss
active-list-5.0.1 app/assets/stylesheets/active_list/background.scss
active-list-5.0.0 app/assets/stylesheets/active_list/background.scss