_box-shadow.scss 532 B

1234567891011121314151617181920
  1. @mixin box-shadow($shadow...) {
  2. @if $enable-shadows {
  3. $result: ();
  4. @if (length($shadow) == 1) {
  5. // We can pass `@include box-shadow(none);`
  6. $result: $shadow;
  7. } @else {
  8. // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
  9. @for $i from 1 through length($shadow) {
  10. @if nth($shadow, $i) != "none" {
  11. $result: append($result, nth($shadow, $i), "comma");
  12. }
  13. }
  14. }
  15. @if (length($result) > 0) {
  16. box-shadow: $result;
  17. }
  18. }
  19. }