Sass does not rewrite files with a prefix

1

I copied some .scss files to my project, these files are prefixed _ in name (eg _style, _mediaqueries, etc.). The compass rewrites all files normally, except those that have prefixes. Some people told me this should not interfere with Sass's behavior.

Can anyone tell me if the problem is in some configuration, or if it does not actually read files with prefixes like this?

    
asked by anonymous 25.08.2015 / 19:00

2 answers

0

SASS interprets files beginning with underline as partial. It's a fairly simple logic because most of the style sheets written in SASS are made up of several partial files and a "compiled" version of them.

The font-awesome, for example, uses this clumsiness:

Whereonlythefont-awesome.scssfileiscompiledinCSSandtheothersarepartialthatcomposeit.

    
28.01.2016 / 16:21
0

Since SASS interprets files with '_' as partial, you simply rename the file to a "common" name that everything will be compiled accordingly.

But attention: usually Frameworks and libraries make partial use just so that files are not compiled .

The correct way to use partials is to import them into the SASS file that will be compiled. The compiler will write in CSS only the classes / functions that were actually used of that partial, not the whole file.

    
22.02.2016 / 19:43