sass的条件判断篇

  • Post author:
  • Post category:其他


<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		/*@mixin triangle($dir,$width,$color)
		{
			width: 0;
			height: 0;
			border-width: $width;
			border-style: solid solid solid solid;
			@if($dir==Up)
			{
				border-color: transparent  transparent  transparent  transparent;
			}
			@else if($dir==Down)
			{
				border-color: $color transparent transparent  transparent; 
			}
			@else if($dir==Left)
			{
				border-color: transparent $color transparent transparent
			}
			@else if($dir==Right)
			{
				border-color: transparent transparent transparent $color;
			}
		}
		div
		{
			@include triangle(Left,50px,blue);
		}*/
		div {
  width: 0;
  height: 0;
  border-width: 50px;
  border-style: solid solid solid solid;
  border-color: transparent blue transparent transparent;
}
	</style>
</head>
<body>
<div></div>
</body>
</html>



版权声明:本文为qq_37805832原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。