Variable in sass

Advertisements

Prev Tutorial Next Tutorial

Variable in sass

Sass allows variables to be defined. Variables begin with a dollar sign ($). Variable assignment is done with a colon (:). In scss $ sign is used for declare variable and in scss ! sign is used for declare variable.

Declare variable in scss

$my-font:    Helvetica, sans-serif;  
$my-color: red;  
  
body {  
  font: 100% $my-font;  
  color: $my-color;  
}  

Declare variable in sass

!my-font:    Helvetica, sans-serif
!my-color: red
  
body 
  font: 100% $my-font  
  color: $my-color

After processing above code it will automatically genrate sytle.css file in root directory.

css file

  
body {  
  font: 100% Helvetica, sans-serif;
  color: red;  
}  

Example of sass Html file

<html>  
<head>  
   <title>Simple Example of sass</title>  
   <link rel="stylesheet" type="text/css" href="style.css"/>  
</head>  
<body>  
   <h1>Simple Sass Example</h1>  
   <h3>This is my first SASS Code</h3>  
   <p>SASS is very simple and easy to learn and use code.</p>  
</body>
</html>
variable in sass
Prev Tutorial Next Tutorial

Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Download Projects

Google Advertisements


Buy Websites 9999595223

Buy Fresh and Payment Receive Media.net Account with Website. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements