@charset "utf-8";

@mixin Yu_default_box_shadow($depth:0) {
  --default-block-box-shadow: #{Yu_structure_box_shadow_var($depth)};
  box-shadow: var(--block-box-shadow, var(--default-block-box-shadow));
}

@mixin Yu_default_box_hover_shadow($depth:0) {
  --default-block-box-hover-shadow: #{Yu_structure_box_shadow_var($depth - 1)};
  box-shadow: var(--block-box-hover-shadow, var(--default-block-box-hover-shadow));
}

@mixin Yu_default_box_active_shadow($depth:0) {
  @if $depth > 0 {
    --default-block-box-active-shadow: #{Yu_structure_box_shadow_var(-$depth)};
  } @else {
    --default-block-box-active-shadow: #{Yu_structure_box_shadow_var($depth - 2)};
  }
  box-shadow: var(--block-box-active-shadow, var(--default-block-box-active-shadow));
}

@mixin Yu_box_shadow($depth:0) {
  --block-box-shadow: #{Yu_structure_box_shadow_var($depth)};
  --block-box-hover-shadow: #{Yu_structure_box_shadow_var($depth - 1)};
  @if $depth > 0 {
    --block-box-active-shadow: #{Yu_structure_box_shadow_var(-$depth)};
  } @else {
    --block-box-active-shadow: #{Yu_structure_box_shadow_var($depth - 2)};
  }
  * {
    --block-box-shadow: var(--default-block-box-shadow);
    --block-box-hover-shadow: var(--default-block-box-hover-shadow);
    --block-box-active-shadow: var(--default-block-box-active-shadow);
  }
}

@function Yu_structure_box_shadow_var($depth:0) {
  @return Yu_structure_box_shadow(var(--left-box-shadow, var(--default-left-box-shadow)), var(--right-box-shadow, var(--default-right-box-shadow)), $depth)
}

@function Yu_structure_box_shadow($left_color,$right_color,$depth:0) {
  $length_1: null;
  $length_2: null;
  $_inset: null;
  @if $depth < 0 {
    $_inset: inset;
    $depth: -$depth;
  } @else {
    $_inset: null;
  }
  @if $depth == 9 {
    $length_1: 50;
    $length_2: 100;
  }
  @if $depth == 8 {
    $length_1: 41;
    $length_2: 82;
  }
  @if $depth == 7 {
    $length_1: 33;
    $length_2: 66;
  }
  @if $depth == 6 {
    $length_1: 25;
    $length_2: 50;
  }
  @if $depth == 5 { //原来的0
    $length_1: 18;
    $length_2: 30;
  }
  @if $depth == 4 {
    $length_1: 11;
    $length_2: 22;
  }
  @if $depth == 3 {
    $length_1: 5;
    $length_2: 10;
  }
  @if $depth == 2 {
    $length_1: 3;
    $length_2: 6;
  }
  @if $depth == 1 {
    $length_1: 1;
    $length_2: 3;
  }

  @if $depth != 0 {
    @return "#{$_inset} #{$length_1}px #{$length_1}px #{$length_2}px #{$right_color},#{$_inset} #{-$length_1}px #{-$length_1}px #{$length_2}px #{$left_color}";
  } @else {
    @return "";
  }
}


