Sass TutorialLesson 6Free preview
Sass @import
This lesson is part of SASS · All levels
Summary
Sass provides the @use and @import rules to break the stylesheet into several partial files. @use is recommended because it imports modules once and gives namespace to variables or mixes so that name conflicts can be avoided. @import is still functional but considered obsolete because the results accumulate to global scope.
Key points
- @use to import a partial file as a module with namespace
- The partial file name is initiated by the bottom line, for example _variables.scss
- @import stacks all the contents of the file to global scope and is deprecated
- One partial file is enough to be imported once even though many other files are used.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.