$variable_name : some value;
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>變量 - www.yiibai.com</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>SASS變量使用示例</h1>
<p>Sass is an extension of CSS that adds power and elegance to the basic language.</p>
</div>
</body>
</html>
接下來(lái)創(chuàng)建一個(gè)文件:style.scss.
$txtcolor:#008000;
$fontSize: 20px;
p{
color:$txtcolor;
font-size:$fontSize;
}
sass --watch C:\Ruby22-x64\style.scss:style.css
p {
color: #008000;
font-size: 20px;
}