_functions.scss 592 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
//////////////////////////////
//  Calculations
@function offset-background-color($color, $percent) {
  @if (lightness($color) < 50) {
    @return lighten($color, $percent);
  } @else {
    @return darken($color, $percent);
  }
}
@function offset-foreground-color($color, $percent) {
  @if (lightness($color) > 50) {
    @return lighten($color, $percent);
  } @else {
    @return darken($color, $percent);
  }
}
@function fade-foreground-color($color, $percent) {
  @if (lightness($color) < 50) {
    @return lighten($color, $percent);
  } @else {
    @return darken($color, $percent);
  }
}