Last active
April 25, 2020 15:32
-
-
Save axxe16/a79a6fac515ee69c4cf5bef0b99927f3 to your computer and use it in GitHub Desktop.
Raccolta @mixin #scss #mixin
This file contains 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 border-radius($radius) { | |
border-radius: $radius; | |
-webkit-border-radius: $radius; | |
-moz-border-radius: $radius; | |
} | |
@mixin transition($property, $duration, $easing: linear) { | |
transition: $property $duration $easing; | |
-webkit-transition: $property $duration $easing; | |
-moz-transition: $property $duration $easing; | |
} | |
@mixin gradient($color1, $color2) { | |
background-color: $color1; | |
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#{$color1}, endColorstr=#{$color2}); | |
background-image: -moz-linear-gradient(center top, $color1, $color2); | |
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($color1), to($color2)); | |
} | |
// A map of breakpoints. | |
$breakpoints: ( | |
xs: 576px, | |
sm: 768px, | |
md: 992px, | |
lg: 1200px | |
); | |
// Respond above. | |
@mixin respond-above($breakpoint) { | |
// If the breakpoint exists in the map. | |
@if map-has-key($breakpoints, $breakpoint) { | |
// Get the breakpoint value. | |
$breakpoint-value: map-get($breakpoints, $breakpoint); | |
// Write the media query. | |
@media (min-width: $breakpoint-value) { | |
@content; | |
} | |
// If the breakpoint doesn't exist in the map. | |
} @else { | |
// Log a warning. | |
@warn 'Invalid breakpoint: #{$breakpoint}.'; | |
} | |
} | |
// Respond above. | |
@mixin respond-under($breakpoint) { | |
// If the breakpoint exists in the map. | |
@if map-has-key($breakpoints, $breakpoint) { | |
// Get the breakpoint value. | |
$breakpoint-value: map-get($breakpoints, $breakpoint); | |
// Write the media query. | |
@media (max-width: $breakpoint-value) { | |
@content; | |
} | |
// If the breakpoint doesn't exist in the map. | |
} @else { | |
// Log a warning. | |
@warn 'Invalid breakpoint: #{$breakpoint}.'; | |
} | |
} | |
/* Typography */ | |
@mixin textShadow { | |
text-shadow: 1px 1px 0.5px rgba(0, 0, 0, 0.85); | |
} | |
/* @include transition(all,2s,ease-out); */ | |
@mixin transition($what: all, $time: 0.2s, $how: ease-in-out) { | |
-webkit-transition: $what $time $how; | |
-moz-transition: $what $time $how; | |
-ms-transition: $what $time $how; | |
-o-transition: $what $time $how; | |
transition: $what $time $how; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment