Created
August 2, 2023 16:12
-
-
Save tranduybau/2eac773a2682ddce5ef0a1cdeefbe97a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin generate-border($width, $color, $position: all) { | |
$shadows: (); | |
@if $position == all { | |
$shadows: append($shadows, inset 0 0 0 #{$width} #{$color}); | |
} @else { | |
@each $dir in top, right, bottom, left { | |
@if index($position, $dir) { | |
$x: 0; | |
$y: 0; | |
@if $dir == top { | |
$y: $width; | |
} @else if $dir == right { | |
$x: -$width; | |
} @else if $dir == bottom { | |
$y: -$width; | |
} @else if $dir == left { | |
$x: $width; | |
} | |
$shadows: append($shadows, inset #{$x} #{$y} 0 0 #{$color}, comma); | |
} | |
} | |
} | |
box-shadow: $shadows; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment