/* @author Bilal Cinarli */

/** -------------------------------------------
    Text Related Mixins
    ------------------------------------------- **/
/**
 * Fontface
 */
@mixin font-face($name, $file, $weight: normal, $style: normal){
    @font-face {
        font-family: "#{$name}";
        src: url("../fonts/#{$file}.eot?caffeine");
        src: url("../fonts/#{$file}.eot?#caffeine") format("embedded-opentype"),
        	 url("../fonts/#{$file}.woff?caffeine") format("woff");
        font-weight: $weight;
        font-style: $style;
    }
}

@mixin fontface($name, $file, $weight: normal, $style: normal){
    @include font-face($name, $file, $weight, $style);
}

/**
 * Font-Size callback
 */
@mixin font-size($font-size){
	$ie8-support: true;
	@if variable_exists(support-for-ie8){
		$ie8-support: $support-for-ie8;
	}
	
    @if ($font-size == inherit){
        font-size: inherit;
    }

    @else {
        @if($ie8-support == true){
            font-size: rem-to-px($font-size);
        }
        font-size: rem($font-size);
    }
}

/**
 * Disable Select
 * It is useful for mobil applications
 * Prevents text selection when swipe or double click
 * http://caniuse.com/#search=user-select
 * https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
 * Formal syntax: none | text | all | element
 * Current spec, all vendors need prefixing
 */
@mixin disable-text-select(){
	@include prefixer('user-select', none, webkit moz ms);
}