Search code examples
csssassstyling

What does it mean to say that partials in SASS stylesheets make them easier to manage?


I understand that partial SASS stylesheets do not compile directly to css, but in what way does this make them easier to manage, and where/when would you use partials vs complete stylesheets?


Solution

  • It just refers to an organizational approach to divide up your SASS files into separate folders and files to represent the different components or other logical parts that make up your app.

    I imagine there are opinions out there about what exactly is the best way to organize your partials, but the typical example just involves organizing your partials into folders and files using some easy-to-follow organizational system and then importing all your partials to main.scss or wherever they ultimately get compiled.

    At the end of the day, it just means breaking up your files into logical manageable chunks. Sort of like the design principle to keep a separation of concerns.

    The intended result is that you or other developers can intuitively find the appropriate file and quickly make necessary changes without having to search too hard or go through as many lines of code.