Sha256: 7e5880b2a3aa9b9caca6f99586e0f2a2ebde8f615888f6984ba1186d4ff8a567

Contents?: true

Size: 1.92 KB

Versions: 12

Compression:

Stored size: 1.92 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-selection-backgrounds: ("&" rgba(#FFF, 0)) ("&.selected" rgba(yellow, 0.3));
$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 $selection-background in $list-selection-backgrounds {
		  #{nth($selection-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($selection-background, 2), nth($hover-background, 2));
				 }
			      }
			   }
			}
		     }
		  }
               }
            }
	 }
      }
   }
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
active_list-6.3.1 app/assets/stylesheets/active_list/background.scss
active_list-6.3.0 app/assets/stylesheets/active_list/background.scss
active_list-6.2.4 app/assets/stylesheets/active_list/background.scss
active_list-6.2.3 app/assets/stylesheets/active_list/background.scss
active_list-6.2.1 app/assets/stylesheets/active_list/background.scss
active_list-6.2.0 app/assets/stylesheets/active_list/background.scss
active_list-6.1.5 app/assets/stylesheets/active_list/background.scss
active_list-6.1.4 app/assets/stylesheets/active_list/background.scss
active_list-6.1.3 app/assets/stylesheets/active_list/background.scss
active_list-6.1.2 app/assets/stylesheets/active_list/background.scss
active_list-6.1.1 app/assets/stylesheets/active_list/background.scss
active_list-6.1.0 app/assets/stylesheets/active_list/background.scss