sass的条件判断篇

2020-10-28 10:37:07 浏览数 (1)

代码语言:javascript复制
<!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>

0 人点赞