// Mixins
//
// @copyright Copyright (c) 2012 rocksolidthemes.com
// @license   https://rocksolidthemes.com/agb   No free usage allowed
//

@mixin ir($image-name: "", $image-extension: "png", $x: left, $y: top, $color: transparent) {
	@if $image-name != "" {
		background: $color inline-image(#{$image-name} + "." + #{$image-extension}, image/#{$image-extension}) $x $y no-repeat;
		width: image-width(#{$image-name} + "." + #{$image-extension});
		height: image-height(#{$image-name} + "." + #{$image-extension});
		display: block;
	}
	@if $image-name == "" {
		display: inline-block;
	}
	overflow: hidden;
	line-height: 0;
	text: {
		indent: -9999px;
		align: left;
	};
	br {
		display: none;
	}
	@if $image-name != "" {
		@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-device-pixel-ratio: 4 / 3), only screen and (min-device-pixel-ratio: 1.3) {
			background-image: inline-image(#{$image-name} + "-x2." + #{$image-extension}, "image/" + #{$image-extension});
			background-size: image-width(#{$image-name} + "." + #{$image-extension}), image-height(#{$image-name} + "." + #{$image-extension});
		}
	}
}

@mixin icon($content: "", $font-size: "100%", $line-height: 1) {
	font: #{$font-size}/#{$line-height} "RockSolid Icons";
	@if $content != "" {
		content: $content;
	}
	-webkit-font-smoothing: antialiased;
	font-smoothing: antialiased;
	text-rendering: geometricPrecision;
	text-indent: 0;
	display: inline-block;
	position: relative;
}

@mixin hidden {
	display: none !important;
	visibility: hidden;
}

@mixin visuallyhidden {
	border: 0;
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	&.focusable {
		&:active, &:focus {
			clip: auto;
			height: auto;
			margin: 0;
			overflow: visible;
			position: static;
			width: auto;
		}
	}
}

@mixin invisible {
	visibility: hidden;
}

@mixin clearfix {
	&:before {
		content: "";
		display: table;
	}
	&:after {
		content: "";
		display: table;
		clear: both;
	}
	zoom: 1;
}

@mixin placeholder {
	&:-webkit-placeholder {
		@content;
	}
	&:-moz-placeholder {
		@content;
	}
	&:-ms-placeholder {
		@content;
	}
	&:-o-placeholder {
		@content;
	}
	&:placeholder {
		@content;
	}
}

@function col($columns, $container-columns) {
	@return $columns / $container-columns * 100%;
}
