Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

What is @import keyword good for in Sass?

Experience Level: Junior
Tags: Sass


Using the keyword @import you can include Sass partials (smaller files with Sass snippets) into the main Sass file. 

The @import keyword is used to merge multiple Sass files into one larger one.


$primary: blue;
$error: red;

button {
  background-color: $primary;
  color: white;
  border: none;

button.error {
  background-color: $error;
  color: white;
  border: none;


.dialog {
  border: solid 1px gray;
  border-radius: 15px;
  padding: 15px;


@import 'buttons';
@import 'dialogs';


No Comments Yet.
Be the first to tell us what you think.
Sass for beginners
Sass for beginners

Are you learning Sass ? Try our test we designed to help you progress faster.

Test yourself