// 全局混入

// 限制一行
@mixin text-ellipsis {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

// 限制多行
@mixin ellipsis-rows($lines) {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: $lines;
	overflow: hidden;
	text-overflow: ellipsis;
}

// 禁止选中
@mixin no-select {
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

// 禁止拖拽
@mixin no-drag {
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	user-select: none;
}

// 点击弹性动画
@mixin click-elastic(
	$duration: 0.2s,
	$active-duration: 0.1s,
	$hover-scale: 1.05,
	$active-scale: 0.92,
	$easing-function: cubic-bezier(0.34, 1.56, 0.64, 1)
) {
	transition: transform $duration $easing-function;

	&:hover {
		transform: scale($hover-scale);
	}
	&:active {
		transform: scale($active-scale);
		transition: transform $active-duration $easing-function;
	}
}
