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

35 lines
779 B
SCSS
Raw Normal View History

@function dynamic-color($color, $lightness: 50, $dark-color: $brand-black, $light-color: $brand-white) {
2017-08-31 11:44:57 +00:00
@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
}
}