DEV Community

Using SASS partials

Sarah Chima on November 13, 2017

Stylesheets grow large overtime. The more they grow, the more difficult it is to maintain them. It only makes sense to break large stylesheets into...
Collapse
 
gopalkumar315 profile image
Gopal Kumar • Edited

Great job, very nice article, it cleared the main intention of scss over css that how smartly we can work with css using scss. Can you elaborate what are partials, actually i know partials are little snippets of html or css code but i need more definition. It would be pleasure if you could explain partials.

Collapse
 
brunoslash76 profile image
Bruno de Moraes

Awesome :) thank you very much for your objective and great article. Happy codding

Collapse
 
niorad profile image
Antonio Radovcic

You don't need to import them again, if they were imported in the main-file at an earlier time. Importing is really just like copypasting the file-contents into the main-file.

Collapse
 
auxiliaryjoel profile image
auxiliaryjoel

when importing files from other folders, is there a way to import multiple files from within a folder without having to specify each files name?

Collapse
 
honsa profile image
honsa

You can do that by writing an index file sass-lang.com/documentation/at-rul...

Collapse
 
qwezii profile image
qwezii

Hi

1) Can we use @use instead?
2) What is the difference between @use and @import?

TIA.

Collapse
 
prashantandani profile image
Prashant Andani

You can use @use to access specific value/variable instead of the whole file being imported

Collapse
 
dapseen profile image
Adedapo ajuwon

Good read..

Partial helps me to resume my style in other projects, which is awesome.

Collapse
 
robinjohnmike profile image
J.M Robin

How do you determine if something is a component or not? I just started learning sass and I'm having trouble deciding if something should be a component or not. Thanks.

Collapse
 
dapseen profile image
Adedapo ajuwon

It's like writing a function in programming language, i divide my components into bit based on the task each is performing.

Think of component as a block of Style that can perform a particular task and also be repeated in your stylesheet
e.g button, navigation, variables,etc, they can be repeated in your present project and other upcoming projects too.