This repository has been archived on 2023-02-03. You can view files and clone it, but cannot push or open issues or pull requests.
autonomic.zone/scss/utilities/color_utilities.scss
2017-08-31 15:02:50 +01:00

35 lines
779 B
SCSS

@function dynamic-color($color, $lightness: 50, $dark-color: $brand-black, $light-color: $brand-white) {
@if (lightness($color) > $lightness){
@return $dark-color; // Lighter background, return dark color
}
@else {
@return $light-color; // Darker background, return light color
}
}
@function tint($color, $percentage) {
@return mix(#fff, $color, $percentage);
}
@function shade($color, $percentage) {
@return mix(#000, $color, $percentage);
}
@mixin placeholder($color) {
&:-moz-placeholder {
color: $color; // Firefox 4-18
}
&::-moz-placeholder {
color: $color; // Firefox 19+
}
&:-ms-input-placeholder {
color: $color; // Internet Explorer 10+
}
&::-webkit-input-placeholder {
color: $color; // Safari and Chrome
}
}