Open In App

SASS | Use variables across multiple files

  • To use variables across multiple files in SASS is carried out by @import rule of SASS.
  • @import rule which import Sass and CSS stylesheets for providing variables, @mixins and functions.Such that combine all stylesheets together for compiled css.
  • It also imports URL such as frameworks like Bootstrap etc..
  • The @import no longer encouraged in future updates so prefer @use rule instead.
  • Syntax:

    /* importing name and file path is /_file.scss */
    @import 'file';
    

    Reference: https://sass-lang.com/documentation/at-rules/import


    Article Tags :