Variable in sass


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
  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

   <title>Simple Example of sass</title>  
   <link rel="stylesheet" type="text/css" href="style.css"/>  
   <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>  
variable in sass
Prev Tutorial Next Tutorial


Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: or 9999595223

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

For Projects 9999595223

Google Advertisements

Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: or 9999595223 Try this Keyword C++ Programs