$white: #ffffff !default;
$black: #000000 !default;

@font-face {
	font-family: 'FontAwesome';
	src: url('/static/xstatic/fonts/fontawesome-webfont.eot');
	src: url('/static/xstatic/fonts/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), url('/static/xstatic/fonts/fontawesome-webfont.woff') format('woff'), url('/static/xstatic/fonts/fontawesome-webfont.ttf') format('truetype'), url('/static/xstatic/fonts/fontawesome-webfont.svg#fontawesomeregular') format('svg');
	font-weight: normal;
	font-style: normal;
}

@mixin vendor-prefix($name, $value) {
	@each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') {
		#{$vendor}#{$name}: #{$value};
	}
}

@function text-color($color) {
	@if (lightness($color) > 50) {
		@return $black;
	} @else {
		@return $white;
	}
}

@function extract-color($border){
	@each $part in $border { @if type-of($part) == color { @return $part; } }
	@return transparent;
}

@function extract-width($border){
	@each $part in $border { 
		@if type-of($part) == number { @return $part; } }
	@return 0;
}

// Check if value is a number > 0;
@function is-positive-number($value) {
	@return type-of($value) == 'number' and $value > 0;
}

// Define desktop media queries depending of unit
@function min-desktop-viewport($limit) {
	$unit: unit($limit);
	@if ($unit == "em" or $unit == "rem") {
		@return $limit + 0.01;
	} @else {
		@return $limit + 1;
	}
}

// Only display content to screen readers
@mixin sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.sr-only {
	@include sr-only();
}

// clearifx
@mixin clearfix {
	&::after {
	  display: block;
	  clear: both;
	  content: "";
	}
	@supports (display: flow-root) {
		display: flow-root;
		&::after {
			content: none;
		}
	}
}

.clearfix {
	@include clearfix();
}

// hidden
[hidden] {
	display: none !important;
}
