// Rem output with px fallback @mixin font-size($sizeValue: 1) { font-size: ($sizeValue * 10) * 1px; font-size: $sizeValue * .625rem; } // Center block @mixin center-block { display: block; margin-left: auto; margin-right: auto; } // Clearfix @mixin clearfix() { content: ""; display: table; table-layout: fixed; } // Clear after (not all clearfix need this also) @mixin clearfix-after() { clear: both; } // Column width with margin @mixin column-width($numberColumns: 3) { width: map-get( $columns, $numberColumns ) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ); } /// Mixin to manage responsive breakpoints /// @author Hugo Giraudel /// @param {String} $breakpoint - Breakpoint name /// @require $breakpoints @mixin breakpoint($breakpoint) { // If the key exists in the map @if map-has-key($breakpoints, $breakpoint) { // Prints a media query based on the value @media #{inspect(map-get($breakpoints, $breakpoint))} { @content; } } // If the key doesn't exist in the map @else { @warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Available breakpoints are: #{map-keys($breakpoints)}."; } } $browser-context: 10; // Default @function em($pixels, $context: $browser-context) { @return #{$pixels/$context}em } // For Microsoft Browsers @mixin msBrowsers() { // IE Browsers @media screen and (-ms-high-contrast: none) { @content; } // Edge @supports (-ms-ime-align: auto) { @content; } }