Skip to content

Instantly share code, notes, and snippets.

@annelyse
Last active August 13, 2024 09:34
Show Gist options
  • Save annelyse/298803c4bac292a58b92e7c522abaf33 to your computer and use it in GitHub Desktop.
Save annelyse/298803c4bac292a58b92e7c522abaf33 to your computer and use it in GitHub Desktop.
use it for slider side content hidden for exemple
@mixin linear-gradient($side, $color) {
/* Chrome10-25,Safari5.1-6 */
background: -webkit-linear-gradient(
$side,
rgba($color, 0) 0%,
rgba($color, 1) 100%
);
/* FF3.6-15 */
background: -moz-linear-gradient(
$side,
rgba($color, 0) 0%,
rgba($color, 1) 100%
);
background: linear-gradient($side, rgba($color, 0) 0%, rgba($color, 1) 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
background: linear-gradient(
to side,
rgba($color, 0) 0%,
rgba($color, 1) 100%
);
}
@mixin gradient-overflow($size, $color: "") {
&:before,
&:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
z-index: 1;
width: $size;
}
&:before {
left: 0;
background: linear-gradient(to left, transparent, $color 75%);
}
&:after {
right: 0;
background: linear-gradient(to right, transparent, $color 75%);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment