X-Git-Url: https://git.danix.xyz/?a=blobdiff_plain;f=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_contrast-switch.scss;fp=assets%2Fsass%2Fbourbon%2Fbourbon%2Flibrary%2F_contrast-switch.scss;h=0000000000000000000000000000000000000000;hb=608ee6ced3bb9f1200894828d5f91dd8d37e3cce;hp=4545be319ecc615d6470438dfcb8c9d348fdb84e;hpb=43912bcaf275017baa77551f359b0b2be498e5b3;p=theme-danix.xyz.git diff --git a/assets/sass/bourbon/bourbon/library/_contrast-switch.scss b/assets/sass/bourbon/bourbon/library/_contrast-switch.scss deleted file mode 100644 index 4545be3..0000000 --- a/assets/sass/bourbon/bourbon/library/_contrast-switch.scss +++ /dev/null @@ -1,81 +0,0 @@ -@charset "UTF-8"; - -/// Switches between two colors based on the contrast to another color. It’s -/// like a [ternary operator] for color contrast and can be useful for building -/// a button system. -/// -/// The calculation of the contrast ratio is based on the [WCAG 2.0 -/// specification]. However, we cannot guarantee full compliance, though all of -/// our manual testing passed. -/// -/// [ternary operator]: https://goo.gl/ccfLqi -/// [WCAG 2.0 specification]: https://goo.gl/zhQuYA -/// -/// @argument {color} $base-color -/// The color to evaluate lightness against. -/// -/// @argument {color} $dark-color [#000] -/// The color to be output when `$base-color` is light. Can also be set -/// globally using the `contrast-switch-dark-color` key in the -/// Bourbon settings. -/// -/// @argument {color} $light-color [#fff] -/// The color to be output when `$base-color` is dark. Can also be set -/// globally using the `contrast-switch-light-color` key in the -/// Bourbon settings. -/// -/// @return {color} -/// -/// @example scss -/// .element { -/// color: contrast-switch(#bae6e6); -/// } -/// -/// // CSS Output -/// .element { -/// color: #000; -/// } -/// -/// @example scss -/// .element { -/// $button-color: #2d72d9; -/// background-color: $button-color; -/// color: contrast-switch($button-color, #222, #eee); -/// } -/// -/// // CSS Output -/// .element { -/// background-color: #2d72d9; -/// color: #eee; -/// } -/// -/// @require {function} _fetch-bourbon-setting -/// -/// @require {function} _is-color -/// -/// @require {function} _contrast-ratio -/// -/// @since 5.0.0 - -@function contrast-switch( - $base-color, - $dark-color: _fetch-bourbon-setting("contrast-switch-dark-color"), - $light-color: _fetch-bourbon-setting("contrast-switch-light-color") -) { - @if not _is-color($base-color) { - @error "`#{$base-color}` is not a valid color for the `$base-color` " + - "argument in the `contrast-switch` function."; - } @else if not _is-color($dark-color) { - @error "`#{$dark-color}` is not a valid color for the `$dark-color` " + - "argument in the `contrast-switch` function."; - } @else if not _is-color($light-color) { - @error "`#{$light-color}` is not a valid color for the `$light-color` " + - "argument in the `contrast-switch` function."; - } @else { - $-contrast-to-dark: _contrast-ratio($base-color, $dark-color); - $-contrast-to-light: _contrast-ratio($base-color, $light-color); - $-prefer-dark: $-contrast-to-dark >= $-contrast-to-light; - - @return if($-prefer-dark, $dark-color, $light-color); - } -}