$variable_name : some value;
<html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>變數 - www.tw511.com</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<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>
接下來建立一個檔案: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; }