_mixins.scss 1.79 KB
// MIXINS
@mixin border-radius($radius) {
	border-radius: $radius;
	background-clip: padding-box; /* stops bg color from leaking outside the border: */
}

@mixin box-shadow($args...) {
	-webkit-box-shadow: $args;
	-moz-box-shadow: $args;
	box-shadow: $args;
}

@mixin checkbox-mark($width, $height, $top, $left, $bg, $border, $content: "", $cursor: pointer, $position: absolute) {
	width: $width;
	height: $height;
	cursor: $cursor;
	position: $position;
	left: $left;
	top: $top;
	background: $bg;
	content: $content;
	border: $border;
}

@mixin opacity($opacity) {
	/* Netscape */
  -moz-opacity: $opacity;

  /* Safari 1.x */
  -khtml-opacity: $opacity;

  /* Good browsers */
	opacity: $opacity;
}

@mixin transition($args...) {

	$duration: 300ms;
	$keys: keywords($args);
	@if map-has-key($keys, duration) {
		$duration: map-get($keys, duration);
	}

	-webkit-transition: $args;
  -o-transition: $args;
  transition: $args;
  -webkit-transition-duration: $duration;
  transition-duration: $duration;
}

@mixin outline($style: none, $width: 0px) {
	&:focus {
		outline-style: $style;
		outline-width: $width;
	}
}

@mixin not-select() {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Chrome/Safari/Opera */
  -khtml-user-select: none;    /* Konqueror */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Non-prefixed version, currently
                                  not supported by any browser */
}

@mixin keyframes($animation-name) {
	@-webkit-keyframes #{$animation-name} {
		@content;
	}
	@-moz-keyframes #{$animation-name} {
		@content;
	}
	@-ms-keyframes #{$animation-name} {
		@content;
	}
	@-o-keyframes #{$animation-name} {
		@content;
	}
	@keyframes #{$animation-name} {
		@content;
	}
}