Sass has an @import rule as well, but Sass does its
importing when it’s compiling to CSS.
1
@import"colors"; /* import include the colors.scss */
The convention for Sass partials is to begin the filenames with _. This tells Sass that
it shouldn’t generate an individual CSS file for the partial, and should only use it for
imports.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* `themes/_night-sky.scss` */
@import "themes/night-sky";
/**
It means, if this variable is already declared,
leave it alone, but otherwise use this value.
**/
$fancybox-width: 400px !default;
.fancybox {
width: $fancybox-width;
}
/* If a user sets $fancybox-width before @importing your Sass partial, then your declara-
tion of400px is ignored because ofthe !default flag. If the user hasn’t setthe value
of $fancybox-width it’ll default to400px.*/
body {
color: #333;// This won't appear in the CSSpadding: 0;/* This will appear in the CSS */
}
body {
color/* This won't appear in the CSS */: #333;padding: 1em;/* Nor will this */ 0;
}
So if .seriousError@extended.important.error ,
it would inherit styles for .important.error and h1.important.error ,
but not for .important or .error .
In this case, you’d probably want .seriousError to @extend.important and .error separately.