SASS @import Directive

Advertisements

Prev Tutorial Next Tutorial

SASS @import Directive

@import directive is used to import the sass or scss files. It directly takes the filename to import. Suppose you have two scss first file is A.scss and second file is B.scss and you want to import A.scss into B.scss.

You can see below example;

A.scss

 html,  
body,
h1,
ul,  
ol {  
   margin: 0;  
  padding: 0;  
}  

B.scss

@import 'A';  
body {  
  font: 100% Helvetica, sans-serif;  
  background-color: cyan;  
}

Note: If the extension of the file is .scss or .sass the file will be imported. If there is no extension sass will try and find a file that matches the name and the proper extension. Syntax to import:

Syntax to import

  
@import "demo.scss";

@import "demo";

CSS file after processing

html, body, h1, ul, ol {  
  margin: 0;  
  padding: 0;  
}  
body {  
  font: 100% Helvetica, sans-serif;  
  background-color: cyan;  
}  

Prev Tutorial Next Tutorial

Google Advertisment

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

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: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements