// -----------------------------------------------------------------------------
// This file contains all application-wide Sass mixins.
// -----------------------------------------------------------------------------

// MIXINS

@mixin size ($width, $height) {
	width: $width;
	height: $height;
}
@mixin flex-align ($main-axis, $cross-axis) {
	justify-content: $main-axis;
	align-items: $cross-axis;
}
@mixin break-text($width) {
	max-width: $width;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
@mixin header ($height, $background) {
	position: relative;
	min-height: $height;
	background-color: $background;
	padding: $padding-main;
	box-shadow: $header-shadow;
}
@mixin btn-bordered ($color) {
	box-shadow: inset 0 0 0 1px $color;
	color: $color;
}

@mixin es-icon ($name, $font-size:10px, $position-type:relative, $position:(), $color:#6db749) {
    @extend .es-#{$name};
    font-size: $font-size;
    color: $color;
    position: $position-type;

    @each $property, $value in $position{
        #{$property}: $value;
    }
}

@mixin card-paragraph-break($width) {
	margin: 0;
	font-size: 15px;
	overflow: hidden;
	height: 20px;
	width: $width;
	line-height: 20px;
	text-overflow: ellipsis;
}

@mixin card-header-break($width) {
	margin: 0;
	overflow: hidden;
	height: 20px;
	width: $width;
	line-height: 20px;
	text-overflow: ellipsis;
}

@mixin es-card-labels ($marginprop, $margin){

	position: absolute;
	display: flex;
	justify-content: space-between;

	.es-labels-item {
		width: 20px;
	    height: 20px;
	    line-height: 20px;
	    font-size: 14px;
	    font-weight: bold;
	    text-align: center;
	    color: $white;
	    border-radius: 2px;
	    cursor: pointer;
	    background-color: es-color(green);
	    background-size: 18px;

	    &:not(:last-child) {
	      #{$marginprop}: $margin;
	    }

	    &.es-label-draft {
	        background-color: es-color(orange, 9);
	    }

	    &.es-label-snapchat {
	        background-size: 12px;
	    }

	    &.es-label-twitter {
	        background-size: 13px;
	    }

	    &.es-label-yahoo {
	        background-size: 7px;
	    }

		&.es-label-linkedin {
        	background-size: 13px;
	    }

	    &.es-label-instagram {
	        background-size: 24px;
	    }
	}
}
