Sha256: a766fe9521a33e41ed658a90c9b155be0ecbe032347093a5d8675d65eaf937e7

Contents?: true

Size: 1.73 KB

Versions: 14

Compression:

Stored size: 1.73 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(255, 255, 255, 0)) (".odd" rgba(255, 255, 255, 0.5)) (".even" rgba(255, 255, 255, 0.5));
$list-column-backgrounds: ("" rgba(255, 255, 255, 0)) (".act" rgba(255, 134, 0, 0)) (".sor" rgba(0, 18, 132, 0.05));
$list-hover-backgrounds: ("" rgba(255, 255, 255, 0)) (":hover" rgba(209, 218, 255, 0.3));

@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

14 entries across 14 versions & 1 rubygems

Version Path
active-list-4.2.4 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.2.3 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.2.2 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.2.1 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.2.0 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.8 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.7 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.6 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.5 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.3 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.2 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.1 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.1.0 lib/active-list/compass/stylesheets/active-list/_background.scss
active-list-4.0.0 lib/active-list/compass/stylesheets/active-list/_background.scss