<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Stefanie Fluin</title>
    <description>The latest articles on Forem by Stefanie Fluin (@stefaniefluin).</description>
    <link>https://forem.com/stefaniefluin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F444547%2F8166195f-0aa9-45ff-b0bf-de589c8f67c4.jpg</url>
      <title>Forem: Stefanie Fluin</title>
      <link>https://forem.com/stefaniefluin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stefaniefluin"/>
    <language>en</language>
    <item>
      <title>The New SASS Module System: Out with @import, In with @use</title>
      <dc:creator>Stefanie Fluin</dc:creator>
      <pubDate>Tue, 04 Aug 2020 22:32:49 +0000</pubDate>
      <link>https://forem.com/stefaniefluin/the-new-sass-module-system-out-with-import-in-with-use-g3m</link>
      <guid>https://forem.com/stefaniefluin/the-new-sass-module-system-out-with-import-in-with-use-g3m</guid>
      <description>&lt;p&gt;In October of 2019 Sass &lt;a href="https://sass-lang.com/blog/the-module-system-is-launched"&gt;announced&lt;/a&gt; their new module system, which primarily addressed the switch from using &lt;code&gt;@import&lt;/code&gt; to &lt;code&gt;@use&lt;/code&gt; instead. Let's dive into what this means and how you should be using this new way to structure your SCSS files.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📝 Note: The new Sass modules and what is outlined below is only compatible with Dart Sass 1.23.0. If you are using LibSass as your Sass engine (ex. VS Code CompileSass uses LibSass) you may have to wait a while longer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is @use
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;@use&lt;/code&gt; is the replacement for &lt;code&gt;@import&lt;/code&gt; which allows other stylesheets to use its variables, functions, and mixins.&lt;/p&gt;

&lt;p&gt;What makes the &lt;code&gt;@use&lt;/code&gt; import different is that the &lt;em&gt;module&lt;/em&gt; (file imported using &lt;code&gt;@use&lt;/code&gt;) is only imported once, no matter how many times you reference it in your project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: You'll see references to what Sass calls "members" - these include variables, functions and mixins within stylesheets. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How to Use @use
&lt;/h2&gt;

&lt;h3&gt;
  
  
  General File Import
&lt;/h3&gt;

&lt;p&gt;The syntax to import a file is almost identical as to what we were already used to with the &lt;code&gt;@import&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;@import '_buttons.scss';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;@use '_buttons.scss';&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Referencing Members
&lt;/h3&gt;

&lt;p&gt;The new modular system does not make all variables available globally. Furthermore, it creates what is called &lt;em&gt;namespaces&lt;/em&gt; for each partial / module, which is the file name by default.&lt;/p&gt;

&lt;p&gt;This means that you have to append the variable name with its namespace name when referencing it in your stylesheet. This helps with naming conflicts in the event you have the same variable name across multiple files, such as &lt;code&gt;$width&lt;/code&gt; in &lt;code&gt;_card.scss&lt;/code&gt; and &lt;code&gt;$width&lt;/code&gt; in &lt;code&gt;_button.scss&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;footer {
    background-color: $forestGreen;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;After:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;footer {
    background-color: constants.$forestGreen;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changing the Namespace (Reference)
&lt;/h3&gt;

&lt;p&gt;If typing out partial stylesheet names seems like too much of an effort, you can modify the name reference as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To Change the Namespace Reference&lt;/strong&gt;&lt;br&gt;
When importing: &lt;code&gt;@use 'constants.scss&lt;/code&gt; as c;` &lt;/p&gt;

&lt;p&gt;When using: &lt;code&gt;background-color: c.$forestGreen;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To Avoid Having to Use a Namespace Reference&lt;/strong&gt;&lt;br&gt;
When importing: &lt;code&gt;@use 'constants.scss' as *;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;When using: &lt;code&gt;background-color: $forestGreen;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: You can also explore using the &lt;code&gt;@forward&lt;/code&gt; rule which does not add any namespaces to names. This is primarily intended for library authors who want to expose only certain parts of their systems or when you want to group several individual pieces into one &lt;em&gt;namespace&lt;/em&gt;. Read more about it below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Private Variables
&lt;/h2&gt;

&lt;p&gt;Members that begin with - (hyphen) or _ (underscore) are private to the current stylesheet with &lt;code&gt;@use&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example, you can reference a private color variable named &lt;code&gt;$_primaryRed&lt;/code&gt; in your &lt;code&gt;_buttons.scss&lt;/code&gt; partial which will only be accessible in that file, and not globally, say in a &lt;code&gt;_footer.scss&lt;/code&gt; partial elsewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Internal Built-In Modules
&lt;/h2&gt;

&lt;p&gt;You may have used built-in Sass functions in the past, such as &lt;code&gt;adjust-hue&lt;/code&gt; and &lt;code&gt;map.get&lt;/code&gt;. Most of these built-in functions will remain available, but not on a global level. This means that you will also need to import these &lt;em&gt;modules&lt;/em&gt; using the new &lt;code&gt;@use&lt;/code&gt; import rule.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@use "sass:color";&lt;/code&gt; or &lt;code&gt;@use "sass:math";&lt;/code&gt; or &lt;code&gt;@use "sass:map";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There are a total of seven built-in modules with very useful functions that you can import. You can read more about them &lt;a href="https://sass-lang.com/documentation/modules"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Types
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Partials
&lt;/h3&gt;

&lt;p&gt;Partial files are formatted with an _ (underscore) at the beginning of the name such as &lt;code&gt;_.buttons.scss&lt;/code&gt;. These files are intended to be parts of a larger system. They are meant to be used as modules and not compiled on their own. I typically have partials roll up into the a main directory file (see next section) that is grouped by types of styles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Index Files
&lt;/h3&gt;

&lt;p&gt;Index files are automatically loaded when you load the URL for the folder into the main stylesheet (&lt;code&gt;styles.scss&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;In the past, you may have created a partial directory file such as &lt;code&gt;_components-dir.scss&lt;/code&gt; that may have imported (&lt;code&gt;@import&lt;/code&gt;) partial files such as &lt;code&gt;_labels.scss&lt;/code&gt; and &lt;code&gt;_buttons.scss&lt;/code&gt;. Now you simply have to either &lt;code&gt;@use&lt;/code&gt; or &lt;code&gt;@forward&lt;/code&gt; the partials into an &lt;code&gt;_index.scss&lt;/code&gt; file within that folder, and make sure you &lt;code&gt;@use&lt;/code&gt; the folder name, in this case &lt;em&gt;components&lt;/em&gt;, in your main &lt;code&gt;styles.scss&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;// components/_index.scss&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;@forward 'labels';&lt;/code&gt;&lt;br&gt;
&lt;code&gt;@forward 'buttons';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;// styles.scss&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;@use 'component';&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📝 Note: Sass can also load plain &lt;code&gt;.css&lt;/code&gt; files using the same &lt;code&gt;@use 'avatar';&lt;/code&gt; format! Just remember that plain &lt;code&gt;.css&lt;/code&gt; files can't take advantage of special Sass variables, functions or mixin features, but it can be extended using &lt;code&gt;@extend&lt;/code&gt; in a Sass stylesheet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  @forward Rule
&lt;/h2&gt;

&lt;p&gt;After some digging, the &lt;code&gt;@forward&lt;/code&gt; rule is quite interesting. What it does is let your members, such as variables, of a forwarded stylesheet be accessible outside of the &lt;code&gt;@use&lt;/code&gt; stylesheet that imports it.&lt;/p&gt;

&lt;p&gt;Using this rule follows a similar syntax as the other import rules:&lt;br&gt;
&lt;code&gt;@forward 'list';&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: You can include both &lt;code&gt;@use&lt;/code&gt; and &lt;code&gt;@forward&lt;/code&gt; rules for the same module in the same file but it is recommended that you write the &lt;code&gt;@forward&lt;/code&gt; first.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The new modular system that implements &lt;code&gt;@use&lt;/code&gt; is now available as of October 2019. As of October 2021 &lt;code&gt;@import&lt;/code&gt; will be deprecated, along with global built-in functions, and one year after that (no later than October 2022) &lt;code&gt;@import&lt;/code&gt; support will be dropped. Make sure you go check out the newly refreshed &lt;a href="https://sass-lang.com/guide"&gt;Sass documentation&lt;/a&gt; for the latest updates.&lt;/p&gt;




&lt;h2&gt;
  
  
  After Thoughts
&lt;/h2&gt;

&lt;p&gt;I personally really enjoyed having globally-accessible variables with my Sass structure, and leaving the modularity to the folder structure itself. This worked for me because I was very meticulous about never using the same variable names, and I often had the liberty of setting up a project stylesheet system by myself, instead of working with several developers (at least usually not until everything was set up).&lt;/p&gt;

&lt;p&gt;With that in mind and my personal preference in naming things, this is how I think I will be formatting my Sass folder and file structure in the future:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AjECvxYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/4ma2pntpb5llbs5lm7rn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AjECvxYg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/4ma2pntpb5llbs5lm7rn.png" alt="Proposed SCSS Folder Structure &amp;amp; Styles Organization" width="800" height="960"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The key things to highlight in having this format are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The main folder names have numbers in front of them, such as &lt;code&gt;0-base&lt;/code&gt; to ensure that the folders stay in that particular order. You can certainly omit this or choose different folder names.&lt;/li&gt;
&lt;li&gt;The folder index files use &lt;code&gt;@forward&lt;/code&gt; with stylesheets that have members that I may want to use in other stylesheets so that they can be easily imported. For example, I import the &lt;code&gt;3-helpers&lt;/code&gt; files using &lt;code&gt;@use&lt;/code&gt; which then lets me freely use the color variables from the &lt;code&gt;_constants.scss&lt;/code&gt; file. You could theoretically do this with all index files, but if you want more control you can only &lt;code&gt;@forward&lt;/code&gt; the files that you want access to more frequently.&lt;/li&gt;
&lt;li&gt;I rename the namespace of the &lt;code&gt;3-helper&lt;/code&gt; import so that I can use it freely without having to type the extra namespace characters - &lt;code&gt;color: $forestGreen&lt;/code&gt; versus &lt;code&gt;color: $helper.forestGreen&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: If you want to check out a different structure system, the &lt;a href="https://sass-guidelin.es/#the-7-1-pattern"&gt;7-1 Sass architecture method&lt;/a&gt; is very well known and highly recommended by the Sass developers.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/introducing-sass-modules/"&gt;https://css-tricks.com/introducing-sass-modules/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.logrocket.com/the-definitive-guide-to-scss/"&gt;https://blog.logrocket.com/the-definitive-guide-to-scss/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sass-lang.com/guide"&gt;https://sass-lang.com/guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.studytonight.com/sass/sass-forward-atrule"&gt;https://www.studytonight.com/sass/sass-forward-atrule&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sass-guidelin.es/#the-7-1-pattern"&gt;https://sass-guidelin.es/#the-7-1-pattern&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Structure SCSS in an Angular App</title>
      <dc:creator>Stefanie Fluin</dc:creator>
      <pubDate>Fri, 31 Jul 2020 23:17:59 +0000</pubDate>
      <link>https://forem.com/stefaniefluin/how-to-structure-scss-in-an-angular-app-3376</link>
      <guid>https://forem.com/stefaniefluin/how-to-structure-scss-in-an-angular-app-3376</guid>
      <description>&lt;p&gt;If you're a lover of SCSS, you'll definitely want to make sure to use it in your Angular applications. Luckily the Angular CLI does all the setup for you!&lt;/p&gt;

&lt;p&gt;Let's first walk through the file changes that the Angular CLI handles for us and how you can modify existing projects to switch over to SCSS for styling. I'll then go over how I like to set up my SCSS files and folder structure when working on Angular projects.&lt;/p&gt;

&lt;p&gt;Let's get into it!&lt;/p&gt;

&lt;h2&gt;
  
  
  New Project Setup Using Angular CLI
&lt;/h2&gt;

&lt;p&gt;When creating a new Angular app using the &lt;code&gt;ng new app-name&lt;/code&gt; command, the CLI will ask you "&lt;em&gt;Which stylesheet format would you like to use?&lt;/em&gt;" - select SCSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ttxhVlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/du4e03l2nfe2vd9d72w8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ttxhVlP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/du4e03l2nfe2vd9d72w8.png" alt="Alt Text" width="554" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When choosing this option when creating a new project, the main things the CLI does is the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adds the &lt;code&gt;src/styles.scss&lt;/code&gt; reference to the &lt;code&gt;angular.json&lt;/code&gt; &lt;code&gt;build/options/styles&lt;/code&gt; section&lt;/li&gt;
&lt;li&gt;Creates a &lt;code&gt;styles.scss&lt;/code&gt; file and adds it to your &lt;code&gt;src&lt;/code&gt; folder&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The CLI will configure the testing files and references as well, but we won't go into those here.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: Run &lt;code&gt;ng --version&lt;/code&gt; in your terminal to check what @angular/cli version you are running, and update to the latest using &lt;code&gt;npm i -g @angular/cli@latest&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Switching Existing Angular Project to SCSS
&lt;/h1&gt;

&lt;p&gt;If you ever need to switch to the SCSS stylesheet format in an existing project, having the two items above should be all you need to get going!&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating CLI Config
&lt;/h3&gt;

&lt;p&gt;The other thing you need to do is update your CLI configuration to create SCSS files instead of CSS files when you create new components. There are two ways to do this - using the CLI command or adding the reference manually. To use the command type the following into your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ng config schematics.@schematics/angular:component.styleext scss&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: Sometimes this command modifies the &lt;code&gt;angular.json&lt;/code&gt; in the wrong place. Make sure it is modified in the top section of your file under your project (usually line 8 or so if you don't have many configuration changes).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To make the change manually add the following schematics reference into your &lt;code&gt;angular.json&lt;/code&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"schematics": {&lt;br&gt;
    "@schematics/angular:component": {&lt;br&gt;
        "style": "scss"&lt;br&gt;
    }&lt;br&gt;
},&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Using the SCSS-Scaffold NPM Package
&lt;/h3&gt;

&lt;p&gt;A while back ago I created an Angular Schematic (you can read more about it here) that adds of all of the SCSS folder structure for you with the easy command npm add scss-scaffold, so you don’t have to 😊.&lt;/p&gt;

&lt;p&gt;You can check it out the post I wrote about it &lt;a href="https://medium.com/@stefaniefluin/quick-guide-to-angular-schematics-how-i-built-my-first-schematic-2c81a486dd3a"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  SCSS Structure
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Global Styling Philosophy
&lt;/h3&gt;

&lt;p&gt;You certainly can keep things simply by having one global &lt;code&gt;styles.scss&lt;/code&gt; SCSS file, and you can also use styling on a component-by-component basis.&lt;/p&gt;

&lt;p&gt;I like to keep my styles as global as possible avoiding component styling as I find that things can get very messy very quickly, especially when working on teams with multiple developers.&lt;/p&gt;

&lt;p&gt;Having global styles keeps everyone using the same structure and system, and encourages discussions about patterns and use cases.&lt;/p&gt;
&lt;h3&gt;
  
  
  SCSS Folder Structure
&lt;/h3&gt;

&lt;p&gt;Once you have your Angular project ready and set up to use SCSS, it's time to move some things around.&lt;/p&gt;

&lt;p&gt;To get things started:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a folder in your &lt;code&gt;src&lt;/code&gt; project folder called &lt;code&gt;styles&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Move your &lt;code&gt;styles.scss&lt;/code&gt; file into the newly created &lt;code&gt;styles&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;Update your &lt;code&gt;angular.json&lt;/code&gt; file to point to the new location of your &lt;code&gt;styles.scss&lt;/code&gt; file.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bf439-tC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/i91oj63w7d0si8q1gf0s.png" alt="Alt Text" width="207" height="56"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, it's time to build out our folder scaffold. I like to follow something similar to the &lt;em&gt;7-1 Pattern&lt;/em&gt; but modify some of the names.&lt;/p&gt;

&lt;p&gt;Below is an example of how I lay out the style folders:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZqD0N7D5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7j6dej722qsrpghyv6b9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZqD0N7D5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7j6dej722qsrpghyv6b9.png" alt="Alt Text" width="398" height="930"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Base Folder
&lt;/h3&gt;

&lt;p&gt;My base folder contains global styles which has some general layout items, a few general default overrides (think normalize.css-type styles), and my base font size so I can use rems consistently.&lt;/p&gt;

&lt;p&gt;The other thing my base folder contains is a typography stylesheet for all things fonts. This not only includes headings and general fonts, but also links and other custom font classes as needed.&lt;/p&gt;
&lt;h3&gt;
  
  
  Pages
&lt;/h3&gt;

&lt;p&gt;I try to use pages sparingly but this is where I put non-standard styles that apply only to a certain page. I often look for patterns and systems to apply globally to re-usable elements, but sometimes  when there are some custom considerations, this is where I'll place them.&lt;/p&gt;
&lt;h3&gt;
  
  
  Modules (or Components)
&lt;/h3&gt;

&lt;p&gt;The Modules (or commonly known as Components), keeps all of my reusable component styles. This includes things like the header and footer, buttons, labels, navigation, cards, or any other elements that you are using throughout your project in several places.&lt;/p&gt;
&lt;h3&gt;
  
  
  Helpers
&lt;/h3&gt;

&lt;p&gt;Helpers is where some of the most important things are. The first thing you'll need is your constants. This stylesheet contains all of the variables for your colors, font-families, z-indexes, and some default sizing. For example, I like to add &lt;code&gt;$border-radius-large&lt;/code&gt; and &lt;code&gt;$border-radius-small&lt;/code&gt; variables to help keep that aspect consistent throughout the app.&lt;/p&gt;

&lt;p&gt;You'll also want to add a mixin stylesheet for some custom-made reusable elements. Mixins allow you to take in arguments - I like to use them for shapes and also for font groups (such as defining a base "title font" style that I can then build upon in my other stylesheets.&lt;/p&gt;
&lt;h3&gt;
  
  
  Vendors (Optional)
&lt;/h3&gt;

&lt;p&gt;Lastly, you might want to include a vendor folder if you're incorporating a third party library like Bootstrap or Normalize.css. Sometimes it helps to keep any vendor-specific configuration or override styles in this vendor folder. You can also import only those specific stylesheets (such as Bootstrap base tools) and keep that here.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: When installing a vendor library, say using NPM, make sure you update your &lt;code&gt;angular.json&lt;/code&gt; file to reference it's source location such as:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
 &lt;code&gt;"styles": [&lt;br&gt;
   "../node_modules/bootstrap/dist/scss/bootstrap.scss",&lt;br&gt;
   "styles/styles.scss"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Print Stylesheet (Optional)
&lt;/h3&gt;

&lt;p&gt;The other file I sometimes like to include is the &lt;code&gt;print.scss&lt;/code&gt; stylesheet that covers any custom print styling of your site. This is especially helpful on very animated or colorful websites that contain technical documentation - you might want to include styles that simplify things, and possibly omit elements for printing for easier content digesting. You could easily put this in your base folder, but I like keeping it separate as it often modifies content significantly different than intended for the overall application when used in its natural format (digital device).&lt;/p&gt;

&lt;h3&gt;
  
  
  SCSS Directory Files
&lt;/h3&gt;

&lt;p&gt;SCSS structure includes having a directory file (i.e. &lt;code&gt;_base-dir.scss&lt;/code&gt;) in each folder that includes all of the individual stylesheets within that folder. Those directory files, then roll up into the 'main' &lt;code&gt;styles.scss&lt;/code&gt; folder which helps keep things clean and organized, and easy to read. I like to set up my directory files to look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2mKMK3H0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/m9m8sc3qpzk7cekdx57r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2mKMK3H0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/m9m8sc3qpzk7cekdx57r.png" alt="Alt Text" width="252" height="126"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The header helps me quickly know what I'm looking at - especially when I'm editing a lot of files. Below are the important pieces where you import the individual stylesheets within that folder, in this case, the base folder.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: Make sure that you add your import to your directory file every time you create a new stylesheet inside of a folder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  SCSS Main File Roll-Up
&lt;/h3&gt;

&lt;p&gt;The last thing that you need is to roll-up all of those directory files into your main &lt;code&gt;styles.scss&lt;/code&gt; file that is actually being read by your app (as we told it to in the &lt;code&gt;angular.json&lt;/code&gt; file).&lt;/p&gt;

&lt;p&gt;This is what my &lt;code&gt;styles.scss&lt;/code&gt; folder might look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oNlx9GQO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/r7hk6sx1awq3bvnp5cfk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oNlx9GQO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/r7hk6sx1awq3bvnp5cfk.png" alt="Alt Text" width="291" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💁🏼 Tip: Remember that the order of imports matters! If you're using constants / variables that your other stylesheets reference, you'll need to make sure that directory import is at the top being imported before the files that are using those variables.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Using Component Styling
&lt;/h2&gt;

&lt;p&gt;If you do want to use component styling but still want to use some of the SCSS structure, you can simply import the specific stylesheet into your &lt;code&gt;your-component.component.scss&lt;/code&gt; file using this format:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@import 'styles/variables';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note that you'll have to update this path if you ever move this file or change its name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;That's it! Once you have SCSS up and running and a nicely organized folder structure, it should help you be much more efficient and organized when it comes to maintaining your stylesheet / CSS code. &lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;h2&gt;
  
  
  After-Thoughts 📋
&lt;/h2&gt;

&lt;p&gt;Although the CLI has lots of configuration options — I find myself wishing there was a “no styles” flag (similar to the &lt;code&gt;--skipTests=false&lt;/code&gt; flag that currently exists) when creating components. Since I structure all of my stylesheets independently in my styles folder, I don’t ever have the need for component based stylesheets.&lt;/p&gt;

&lt;p&gt;Luckily, if it’s something you’re looking for there are flags for inline styling, external styling and changing your stylesheet preference configurations (as we saw above).&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources 🧰
&lt;/h2&gt;

&lt;p&gt;Here are some resources if you want to learn more about SCSS and the using SCSS with Angular and the CLI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://sass-guidelin.es/#architecture"&gt;SASS Guidelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sass-lang.com/styleguide/layout"&gt;Official SASS Lang Layout&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://scotch.io/tutorials/using-sass-with-the-angular-cli"&gt;Scotch.io Tutorial&lt;/a&gt; (outdated but helpful background info)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://angular.io/cli"&gt;Angular CLI Commands&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>sass</category>
    </item>
  </channel>
</rss>
