<?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>DEV Community: nass84</title>
    <description>The latest articles on DEV Community by nass84 (@nass84).</description>
    <link>https://dev.to/nass84</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%2F681408%2F23ec99ec-6f37-4ce8-96cc-d7c86d253bc1.jpeg</url>
      <title>DEV Community: nass84</title>
      <link>https://dev.to/nass84</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nass84"/>
    <language>en</language>
    <item>
      <title>Sass - Variables and Mixins and Functions! Oh my! </title>
      <dc:creator>nass84</dc:creator>
      <pubDate>Fri, 06 Aug 2021 19:03:15 +0000</pubDate>
      <link>https://dev.to/nass84/sass-variables-and-mixins-and-functions-oh-my-22hj</link>
      <guid>https://dev.to/nass84/sass-variables-and-mixins-and-functions-oh-my-22hj</guid>
      <description>&lt;h2&gt;
  
  
  CSS Preprocessors
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What are they?
&lt;/h3&gt;

&lt;p&gt;CSS preprocessors let us write CSS rules in a structured way which get converted to pure CSS by any compiler or loader.&lt;/p&gt;

&lt;p&gt;CSS Preprocessors compile the code which is written using a special compiler.  Browsers don't understand SASS so they need it translated into CSS. &lt;/p&gt;

&lt;p&gt;Once compiled they then use that to create a CSS file, which can then be referenced by the main HTML document.&lt;/p&gt;

&lt;p&gt;Most popular CSS preprocessors:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sass-lang.com/"&gt;&lt;strong&gt;SASS - Syntactically Awesome Style Sheet&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://lesscss.org/"&gt;&lt;strong&gt;LESS - Leaner Style Sheets&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://stylus-lang.com/"&gt;&lt;strong&gt;Stylus - Stylesheet language&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of using them
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Preprocessors let us write more flexible styles by using variables, functions, conditional statements that make our development easier.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can join multiple stylesheets into one by importing all of them into the main CSS file. This allows us to organise our files to keep on top of CSS for large projects. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Repetition can be avoided by writing the common rules together and using that as a mixin or function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Darken and Lighten functionality to create night mode to completely change up your website at a click of a button.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of these features help us to write CSS with less effort and time but efficiently.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some, such as SASS, has specific style standards which are meant to make the writing of the document even easier, such as the freedom to omit braces if you want.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SASS ( Syntactically-awesome style sheets)
&lt;/h2&gt;

&lt;p&gt;This appears to be the most popular choice for developers, it was first written in Ruby and then other languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use Sass
&lt;/h3&gt;

&lt;p&gt;There are many tutorials available to get a feel of using SASS. &lt;/p&gt;

&lt;p&gt;If you would like to learn without using an automatic compiler you could use: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/give-more-oompf-to-your-web-garnishes-with-preprocessors-in-sass-bd379226a114/"&gt;How to use Sass - Step by Step guide&lt;/a&gt; - &lt;em&gt;(Between 1 and 2 hours)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For an in-depth look into SASS with using an automatic compiler:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/give-more-oompf-to-your-web-garnishes-with-preprocessors-in-sass-bd379226a114/"&gt;Sass Tutorial for Beginners &lt;/a&gt;  - &lt;em&gt;(2 hour video plus coding time. I would recommend putting aside half a day)&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=_a5j7KoflTs"&gt;SASS Tutorial  - Net Ninja Course&lt;/a&gt; -  &lt;em&gt;1 hour video plus coding time. This is my favourite tutorial)&lt;/em&gt;*&lt;/p&gt;

&lt;h3&gt;
  
  
  How to install
&lt;/h3&gt;

&lt;p&gt;Install node-sass&lt;/p&gt;

&lt;p&gt;In terminal install globally&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install node-sass -g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Folder: SASS-Demo&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File in folder: index.html&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File in folder: style.scss&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Dont forget to link the style file to html&lt;/em&gt; 😊&lt;/p&gt;

&lt;p&gt;Then add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;

&amp;lt;div&amp;gt;

&amp;lt;h1&amp;gt; Sass Demo&amp;lt;/h1&amp;gt;

&amp;lt;button class="save"&amp;gt; Save &amp;lt;/button&amp;gt;

&amp;lt;button class="cancel"&amp;gt; Cancel &amp;lt;/button&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Variables help you centralize CSS properties. You can assign them once at the top of a file and use them throughout the file. These variables are like placeholders for a CSS property’s value. In Sass, a variable name must start with a $ sign.&lt;/p&gt;

&lt;p&gt;Create in style.css file $h1-color and $h1-height variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$h1-color : blue;

$h1-height : 50px;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1{

color : $h1-color;

height : $h1-height;

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open terminal in the demo folder and execute&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node-sass style.scss style.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This will create a style.scss file&lt;/p&gt;

&lt;p&gt;You can then open the index.html in browser&lt;/p&gt;

&lt;h3&gt;
  
  
  Operators
&lt;/h3&gt;

&lt;p&gt;Sass provides basic math operators like addition +, subtraction -, multiplication * and division/.&lt;/p&gt;

&lt;p&gt;You can use variables and operators together to manipulate CSS properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
$h1-color : blue;

$h1-font : 50px;

$div-width : 500px;


div{

width: $div-width;

}

h1{

color : $h1-color;

height : $h1-font;

padding : $div-width / 10;

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mixins
&lt;/h3&gt;

&lt;p&gt;Mixins group related properties and can be reused in style blocks. They can pass variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@mixin border-radius($radius){

-webkit-border-radius : $radius;  

-moz-border-radius : $radius;  

-ms-border-radius : $radius;

border-radius : $radius;

}


div{

width : $div-width;

border : 2px solid grey;

@include border-radius(20px);

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we used the @mixin directive to define a mixin named border-radius. This mixin contains all the possible properties to set the radius of a border. We also passed a parameter to this mixin. Whenever you need to set the radius of an element, include this mixin with the &lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt;
 keyword.&lt;/p&gt;

&lt;p&gt;To apply these changes you have to compile the script once again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node-sass style.scss style.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nesting
&lt;/h3&gt;

&lt;p&gt;You can nest selectors to apply classes using hover, focus and active&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div{

&amp;gt;h1{

color: blue;

&amp;amp;:hover{

color: greenyellow;

}

}

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Inheritance
&lt;/h3&gt;

&lt;p&gt;We can create a parent style for items that share most of their characteristics such as padding, font-size, margin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
%common-button{


padding: 16px 8px; 

border: none;

font-size: 18px;

}


.save{ 

@extend %common-button;


background-color: blue; 

color: white;

}


.cancel{

@extend %common-button;

background-color: goldenrod;

color: white;

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To declare a parent style, use the % sign. Use the @extend directive to inherit a child block.&lt;/p&gt;

&lt;h3&gt;
  
  
  Import
&lt;/h3&gt;

&lt;p&gt;Sass can create partial files to create small modular Sass files to make files more organised and easier to maintain&lt;/p&gt;

&lt;p&gt;The naming convention for partial files is to prefix the file name with an underscore _.&lt;/p&gt;

&lt;p&gt;Create a file called _buttonpartial.scss&lt;/p&gt;

&lt;p&gt;then use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@import '_buttonpartial';

h1{

color:blue;

}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the root Sass script&lt;/p&gt;

&lt;h2&gt;
  
  
  Loop
&lt;/h2&gt;

&lt;p&gt;Iteration is one of the most frequently used programming mechanisms. Sass script allows you to iterate over variables. You can use various directives like @for, @each and @while.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$totalButton: 2;


@for $i from 1 through $totalButton{

.button-#{$i} {

width: 50px * $i;

height: 120px / $i;

}


}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stop needing to compile everytime!
&lt;/h3&gt;

&lt;p&gt;There is a fancy way to avoid repetitive compiling: a task runner. Visual Studio Code has a built-in task runner, but you can use any task runner of your choice. Gulp is another popular task runner. For compiling Sass script with Gulp, you would need gulp sass compiler instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/gulp-sass"&gt;Gulp-Sass&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or you can download &lt;a href="https://prepros.io/downloads"&gt;PrePros&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Set up instructions can be found here: (How to set up React and Sass using Prepros)&lt;br&gt;
&lt;a href="https://dev.to/nass84/how-to-set-up-react-and-sass-using-prepros-22m1"&gt;https://dev.to/nass84/how-to-set-up-react-and-sass-using-prepros-22m1&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://sass-lang.com/"&gt;&lt;strong&gt;SASS - Syntactically Awesome Style Sheet&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Acknowledgements
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://twitter.com/thenetninjauk?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor"&gt;Net Ninja&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/alim1496/should-i-start-using-a-css-preprocessor-41dn"&gt;Mohammad Abdul Alim&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/give-more-oompf-to-your-web-garnishes-with-preprocessors-in-sass-bd379226a114/"&gt;Chandrabhan Singh&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>css</category>
      <category>design</category>
    </item>
    <item>
      <title>How to set up React and Sass using Prepros</title>
      <dc:creator>nass84</dc:creator>
      <pubDate>Fri, 06 Aug 2021 18:08:34 +0000</pubDate>
      <link>https://dev.to/nass84/how-to-set-up-react-and-sass-using-prepros-22m1</link>
      <guid>https://dev.to/nass84/how-to-set-up-react-and-sass-using-prepros-22m1</guid>
      <description>&lt;p&gt;To build my Mystery Club website, I used React and Sass. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nass84/mystery-club"&gt;Link to Code on Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to set up React and Sass
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;For detailed instructions you can use:&lt;br&gt;
&lt;a href="https://reactjs.org/docs/create-a-new-react-app.html#create-react-app"&gt;Set up React App Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Start Guide
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In terminal run
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app my-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-app

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Create File Structure
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Set up folder for components, CSS and Images with the following files in:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;components&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pages&lt;/li&gt;
&lt;li&gt;basic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;CSS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sass&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;images&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Create Components
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Remember - Components should start with a capital letter&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove code from App.js and replace with your code, for example:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import './CSS/App.css'

function App() {

const title = 'Mystery Club'

return (

&amp;lt;div className="App"&amp;gt;

&amp;lt;div className="content"&amp;gt;

&amp;lt;h1&amp;gt; {title} &amp;lt;/h1&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/div&amp;gt;

);

}


export default App;




&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Create new file navbar.js in basic Components folder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Make sure you have extension - React Standard Style code snippets&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type sfc tab and a stateless functional component will appear
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const Navbar = () =&amp;gt; {

return (

&amp;lt;nav className="navbar"&amp;gt;

&amp;lt;h1&amp;gt;Mystery Club&amp;lt;/h1&amp;gt;

&amp;lt;div className="links"&amp;gt;

&amp;lt;a href="/"&amp;gt;Home&amp;lt;/a&amp;gt;

&amp;lt;a href="/create"&amp;gt;New Mystery&amp;lt;/a&amp;gt;

&amp;lt;/div&amp;gt;

&amp;lt;/nav&amp;gt;

);

}

export default Navbar;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Import Navbar to App.js
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import Navbar from './components/basic/navbar';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Add to App.js
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;Navbar /&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Create another component in basic component folder
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const Home = () =&amp;gt; {

return (

&amp;lt;div className="home"&amp;gt;

&amp;lt;h2&amp;gt;Homepage&amp;lt;/h2&amp;gt;

&amp;lt;/div&amp;gt;

);

}

export default Home;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;import it to App.Js, as above&lt;/p&gt;
&lt;h2&gt;
  
  
  Set Up Sass
&lt;/h2&gt;

&lt;p&gt;For detailed instructions you can use:&lt;br&gt;
&lt;a href="https://reactjs.org/docs/create-a-new-react-app.html#create-react-app"&gt;Set up React App Documentation&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Start Guide
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Download Prepros &lt;a href="https://prepros.io/downloads"&gt;https://prepros.io/downloads&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Set Up Project
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create styles.scss in CSS Sass Folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Drag project folder to Prepros&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on styles.scss in prepros with process automatically ticked&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Process File&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Notification saying successful should pop up.&lt;br&gt;
In VS code a new file should appear called styles.css&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Link this to app.js&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import './CSS/styles.css'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Add practice code to scss file
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
.title{

color:red;

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  CSS File Structure
&lt;/h3&gt;
&lt;h4&gt;
  
  
  @import
&lt;/h4&gt;

&lt;p&gt;You can add Variables, Mixins and main styles into different files by importing them&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create new files in the SASS folder&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;variables.scss&lt;/li&gt;
&lt;li&gt;mixins.scss&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bring up prepros and remove the auto compile tick box so a new css folder isnt created. Leave the tick in main scss file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add mixins and variables into the new files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;import files into styles.scss folder&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
@import 'variables';

@import 'mixins';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Create variable in variables folder
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
$hotPink: #e42491;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;use in styles.scss file to check it is working&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;You're done!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you need more help the documentation can be found here:&lt;br&gt;
&lt;a href="https://create-react-app.dev/docs/adding-a-sass-stylesheet/"&gt;React Website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://sass-lang.com/guide"&gt;Sass Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For great tutorials, i would recommend using &lt;a href="https://twitter.com/thenetninjauk?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor"&gt;Net Ninja&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=j942wKiXFu8&amp;amp;list=PL4cUxeGkcC9gZD-Tvwfod2gaISzfRiP9d"&gt;Net Ninja Tutorial on React&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/playlist?list=PL4cUxeGkcC9iEwigam3gTjU_7IA3W2WZA"&gt;Net Ninja Tutorial on Sass&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>react</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
