+ 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 !

20th Sep 2020, 4:27 PM
Priyanshu Gupta(प्रियांशु गुप्ता)
Priyanshu Gupta(प्रियांशु गुप्ता) - avatar
3 Antworten
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
23rd Sep 2020, 3:33 AM
Prajwal landge
+ 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;
22nd Sep 2020, 7:47 PM
Prajwal landge
+ 1
Prajwal landge what are the benefits of doing this ?
23rd Sep 2020, 3:16 AM
Priyanshu Gupta(प्रियांशु गुप्ता)
Priyanshu Gupta(प्रियांशु गुप्ता) - avatar