@use "sass:math";

@function double($var){
	@return $var * 2;
}

@function half($var){
    @return math.div($var, 2);
}

@mixin absolute-element() {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

@mixin transition($ms: $transition-time) {
	-webkit-transition: all $ms $transition-method;
	-moz-transition: all $ms $transition-method;
	-ms-transition: all $ms $transition-method;
	-o-transition: all $ms $transition-method;
	transition: all $ms $transition-method;
}

@mixin border-radius($var) {
	-webkit-border-radius: $var;
	-moz-border-radius: $var;
	-ms-border-radius: $var;
	border-radius: $var;
}

@mixin background-size($var){
	-webkit-background-size: $var !important;
	-moz-background-size: $var !important;
	-o-background-size: $var !important;
	background-size: $var !important;
}

@mixin backface-visibility($var){
	-webkit-backface-visibility: $var;
	-moz-backface-visibility: $var;
	-ms-backface-visibility: $var;
	backface-visibility: $var;
}

@mixin optional-at-root($sel) {
    @at-root #{if(not &, $sel, selector-append(&, $sel))} {
        @content;
    }
}

@mixin placeholder {
    @include optional-at-root('::-webkit-input-placeholder') {
        @content;
    }
    @include optional-at-root(':-moz-placeholder') {
        @content;
    }
    @include optional-at-root('::-moz-placeholder') {
      @content;
    }
    @include optional-at-root(':-ms-input-placeholder') {
       @content;
    }
}
