// Table of Contents // ================================================== // Common Functions // Helper Functions // Attribute Functions // Vendor Mixins // Common Funtions // ================================================== @function dasherize($selector, $key) { @if $key { @return #{$selector}-#{$key}; } @else { @return #{$selector}; } } @function map-collect($maps...) { $collection: (); @each $map in $maps { $collection: map-merge($collection, $map); } @return $collection; } // Helper Funtions // ================================================== @function breakpoint-min-width($size) { $widths: map-get($grid-container-widths, $size); @return nth($widths, 2); } @function breakpoint-max-width($size) { $width: breakpoint-min-width($size); @return $width - 1px; } @function breakpoint-half-width($size) { $width: breakpoint-min-width($size); @return $width / 2; } @function text-color-on($color) { @if index($colors-text-alt, $color) { @return color(steel); } @else { @return color(white); } } // Attribute Funtions // ================================================== @function border-radius($size) { @return map-get($common-border-radiuses, $size); } @function color($color) { @return map-get($colors, '' + $color); } @function color-0($color) { @return tint($color, 90%); } @function color-50($color) { @return tint($color, 80%); } @function color-100($color) { @return tint($color, 60%); } @function color-200($color) { @return tint($color, 45%); } @function color-300($color) { @return tint($color, 30%); } @function color-400($color) { @return tint($color, 15%); } @function color-500($color) { @return color($color); } @function color-600($color) { @return shade($color, 15%); } @function color-700($color) { @return shade($color, 30%); } @function color-800($color) { @return shade($color, 45%); } @function color-900($color) { @return shade($color, 60%); } @function color-hover($color) { @return darken(color($color), 1.75%); } @function color-lucidity($color, $percentage) { @return rgba(color($color), $percentage); } @function color-opacify($color, $percentage) { @return opacify(color($color), $percentage); } @function color-transparentize($color, $percentage) { @return transparentize(color($color), $percentage); } @function progress-size($size) { @return map-get($progress-sizes, $size); } @function shade($color, $percentage) { @return mix(black, color($color), $percentage); } @function text-family($family) { @return map-get($font-families, $family); } @function text-line-height($line-height) { @return map-get($font-line-heights, $line-height); } @function text-size($size) { @return map-get($font-sizes, $size); } @function text-space($space) { @return map-get($font-spaces, $space); } @function text-weight($weight) { @return map-get($font-weights, $weight); } @function tint($color, $percentage) { @return mix(white, color($color), $percentage); } // Vendor Mixins // ================================================== @mixin animation($animation...) { -webkit-animation: $animation; -ms-animation: $animation; animation: $animation; } @mixin animation-delay($delay) { -webkit-animation-delay: $delay; -ms-animation-delay: $delay; animation-delay: $delay; } @mixin animation-duration($duration) { -webkit-animation-duration: $duration; -ms-animation-duration: $duration; animation-duration: $duration; } @mixin animation-fill-mode($mode) { -webkit-animation-fill-mode: $mode; -ms-animation-fill-mode: $mode; animation-fill-mode: $mode; } @mixin animation-iteration-count($iteration-count) { -webkit-animation-iteration-count: $iteration-count; -ms-animation-iteration-count: $iteration-count; animation-iteration-count: $iteration-count; } @mixin animation-name($name) { -webkit-animation-name: $name; -ms-animation-name: $name; animation-name: $name; } @mixin animation-timing-function($function) { -webkit-animation-timing-function: $function; -ms-animation-timing-function: $function; animation-timing-function: $function; } @mixin appearance($appearance) { -webkit-appearance: $appearance; -ms-appearance: $appearance; appearance: $appearance; } @mixin backface-visibility ($visibility) { -webkit-backface-visibility: $visibility; -ms-backface-visibility: $visibility; backface-visibility: $visibility; } @mixin background-image($background-image...) { background-image: -webkit-linear-gradient($background-image); background-image: -ms-linear-gradient($background-image); background-image: linear-gradient($background-image); } @mixin background-size($size) { -webkit-background-size: $size; -ms-background-size: $size; background-size: $size; } @mixin overflow-scrolling($scroll) { -webkit-overflow-scrolling: $scroll; -ms-overflow-scrolling: $scroll; overflow-scrolling: $scroll; } @mixin tap-highlight-color($color) { -webkit-tap-highlight-color: $color; -ms-tap-highlight-color: $color; tap-highlight-color: $color; } @mixin text-decoration-skip($object) { -webkit-text-decoration-skip: $object; -ms-text-decoration-skip: $object; text-decoration-skip: $object; } @mixin text-fill-color($color) { -webkit-text-fill-color: $color; -ms-text-fill-color: $color; text-fill-color: $color; } @mixin text-size-adjust($size) { -webkit-text-size-adjust: $size; -ms-text-size-adjust: $size; text-size-adjust: $size; } @mixin transform($transform) { -webkit-transform: $transform; -ms-transform: $transform; transform: $transform; } @mixin transform-origin($origin) { -webkit-transform-origin: $origin; -ms-transform-origin: $origin; transform-origin: $origin; } @mixin transition($transition) { -webkit-transition: $transition; -ms-transition: $transition; transition: $transition; } @mixin user-select($select) { -webkit-user-select: $select; -ms-user-select: $select; user-select: $select; }