/* ==================================================================================================================== Functions For 99% of the framework I used Compass' and Susy's functions but I've made some for covering edge cases. Styleguide 24 ==================================================================================================================== */ // Convert Easing from Transform to Transition // -------------------------------------------------------------------------------------------------------------------- @function toBezier($easing) { @if $easing == linear { @return linear; } @elseif $easing == ease { @return ease; } @elseif $easing == ease-in { @return ease-in; } @elseif $easing == ease-out { @return ease-out; } @elseif $easing == ease-in-out { @return ease-in-out; } @elseif $easing == easeInQuad { @return cubic-bezier(0.550, 0.085, 0.680, 0.530); } @elseif $easing == easeInCubic { @return cubic-bezier(0.550, 0.055, 0.675, 0.190); } @elseif $easing == easeInQuart { @return cubic-bezier(0.895, 0.030, 0.685, 0.220); } @elseif $easing == easeInQuint { @return cubic-bezier(0.755, 0.050, 0.855, 0.060); } @elseif $easing == easeInSine { @return cubic-bezier(0.470, 0.000, 0.745, 0.715); } @elseif $easing == easeInExpo { @return cubic-bezier(0.950, 0.050, 0.795, 0.035); } @elseif $easing == easeInCirc { @return cubic-bezier(0.600, 0.040, 0.980, 0.335); } @elseif $easing == easeInBack { @return cubic-bezier(.600, -0.280, 0.735, 0.045); } @elseif $easing == easeOutQuad { @return cubic-bezier(0.250, 0.460, 0.450, 0.940); } @elseif $easing == easeOutCubic { @return cubic-bezier(0.215, 0.610, 0.355, 1.000); } @elseif $easing == easeOutQuart { @return cubic-bezier(0.165, 0.840, 0.440, 1.000); } @elseif $easing == easeOutQuint { @return cubic-bezier(0.230, 1.000, 0.320, 1.000); } @elseif $easing == easeOutSine { @return cubic-bezier(0.390, 0.575, 0.565, 1.000); } @elseif $easing == easeOutExpo { @return cubic-bezier(0.190, 1.000, 0.220, 1.000); } @elseif $easing == easeOutCirc { @return cubic-bezier(0.075, 0.820, 0.165, 1.000); } @elseif $easing == easeOutBack { @return cubic-bezier(0.175, 0.885, 0.320, 1.275); } @elseif $easing == easeInOutQuad { @return cubic-bezier(0.455, 0.030, 0.515, 0.955); } @elseif $easing == easeInOutCubic { @return cubic-bezier(0.645, 0.045, 0.355, 1.000); } @elseif $easing == easeInOutQuart { @return cubic-bezier(0.770, 0.000, 0.175, 1.000); } @elseif $easing == easeInOutQuint { @return cubic-bezier(0.860, 0.000, 0.070, 1.000); } @elseif $easing == easeInOutSine { @return cubic-bezier(0.445, 0.050, 0.550, 0.950); } @elseif $easing == easeInOutExpo { @return cubic-bezier(1.000, 0.000, 0.000, 1.000); } @elseif $easing == easeInOutCirc { @return cubic-bezier(0.785, 0.135, 0.150, 0.860); } @elseif $easing == easeInOutBack { @return cubic-bezier(.680, -0.550, 0.265, 1.550); } @else { @return null; } } /* -------------------------------------------------------------------------------------------------------------------- neg() Convert a value to negative. Example: left: neg(10em); Become: left: -10em Styleguide 24.2 -------------------------------------------------------------------------------------------------------------------- */ @function neg($n) { @return (0 - $n); } /* -------------------------------------------------------------------------------------------------------------------- rhythm_neg() Create a negative `rhythm()` value. More info about the rhythm function: [ Vertical Rhythm](http://compass-style.org/reference/compass/typography/vertical_rhythm/#function-rhythm). Example: margin-left: rhythm_neg(1); Become: margin-left: -1.42857em; Styleguide 24.3 -------------------------------------------------------------------------------------------------------------------- */ @function rhythm_neg($i: 1) { @return -(rhythm($i)); } /* -------------------------------------------------------------------------------------------------------------------- space_neg() Similar to `rhythm_neg()` but for Susy's `space()` function, more info: [Susy Reference](http://susy.oddbird.net/guides/reference/#ref-space). Styleguide 24.4 -------------------------------------------------------------------------------------------------------------------- */ @function space_neg($w: 1, $c: 12) { @return -(space($w, $c)); }