+ 2
Understanding partials in sass .
Please explain me the concept of partials in sass . Didn't get the meaning of partials of it . Thanks in anticipation !
3 ответов
0
As I said it does not transpile code for ex- if you create seperate file(css) containing definition for your site color,font,size and then include it in another(css) , since the sole purpose of one file is to be included in another there is no need to transpile it directly , and making it partial helps us doing that by just adding underscore before file name:
_filename.scss
+ 1
By default, Sass transpiles(converts source code from one programming language to other programming language)all the .scss files directly. However, when you want to import a file, you do not need the file to be transpiled directly.
Sass has a mechanism for this: If you start the filename with an underscore, Sass will not transpile it. Files named this way are called partials in Sass.
So, a partial Sass file is named with a leading underscore:
Sass Partial Syntax:
_filename;
+ 1
Prajwal landge what are the benefits of doing this ?