<?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: Beatrice</title>
    <description>The latest articles on Forem by Beatrice (@techwithtris).</description>
    <link>https://forem.com/techwithtris</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%2F59391%2F34180556-33a4-4d4b-8da4-77ce1cc4153d.jpg</url>
      <title>Forem: Beatrice</title>
      <link>https://forem.com/techwithtris</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/techwithtris"/>
    <language>en</language>
    <item>
      <title>Create a new repo from your command line</title>
      <dc:creator>Beatrice</dc:creator>
      <pubDate>Sun, 06 Sep 2020 09:09:20 +0000</pubDate>
      <link>https://forem.com/techwithtris/create-a-new-repo-from-your-command-line-e2a</link>
      <guid>https://forem.com/techwithtris/create-a-new-repo-from-your-command-line-e2a</guid>
      <description>&lt;h2&gt;
  
  
  Assumptions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You have the Github CLI installed&lt;/li&gt;
&lt;li&gt;You've set up your Github username, password, SSH keys etc on your machine&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Command
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -u USERNAME:PASSWORD https://api.github.com/user/repos -d '{"name":"REPO NAME"}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! You can create a new repository in your command line this way. Then, perform &lt;code&gt;git remote add origin git@github.com:USERNAME/REPONAME.git&lt;/code&gt; like you always do, and push your work. :)&lt;/p&gt;

</description>
      <category>github</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Setting Up Your Gulpfile - A Simple Frontend Development Workflow </title>
      <dc:creator>Beatrice</dc:creator>
      <pubDate>Sun, 16 Aug 2020 05:23:25 +0000</pubDate>
      <link>https://forem.com/techwithtris/setting-up-your-gulpfile-a-simple-frontend-development-workflow-3on8</link>
      <guid>https://forem.com/techwithtris/setting-up-your-gulpfile-a-simple-frontend-development-workflow-3on8</guid>
      <description>&lt;p&gt;If you're also working on &lt;a href="https://www.frontendmentor.io/"&gt;Frontend Mentor&lt;/a&gt;’s amazing exercises, this would help your dev process tremendously.&lt;/p&gt;

&lt;p&gt;This is a modification from &lt;a href="https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync"&gt;this article&lt;/a&gt;. Follow the steps detailed there and check out my mods below.&lt;/p&gt;

&lt;p&gt;Great for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Watching SCSS subfolders and every file in them&lt;/li&gt;
&lt;li&gt;Reloading and compiling whenever you make changes to your SCSS and HTML files&lt;/li&gt;
&lt;li&gt;Simple file systems&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Before you begin
&lt;/h2&gt;

&lt;p&gt;You can refer to these tutorials (&lt;a href="https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync"&gt;Themesburg&lt;/a&gt;, &lt;a href="https://css-tricks.com/gulp-for-beginners/#globbing-in-node"&gt;CSS-Tricks&lt;/a&gt;) to install NPM, Gulp, and all the other goodies you’ll need to make this work.&lt;/p&gt;

&lt;h2&gt;
  
  
  My project structure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ip2RKM3l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p7hiotzngu1znsay26vh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ip2RKM3l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p7hiotzngu1znsay26vh.png" alt="Project file structure"&gt;&lt;/a&gt;&lt;br&gt;
The gulpfile in the &lt;a href="https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync"&gt;tutorial&lt;/a&gt; I linked above works great for simpler structures without sub-folders, but since I’m interested in making my code more modular, I’ve followed the &lt;a href="https://vanseodesign.com/css/sass-directory-structures/"&gt;simple scss file structure&lt;/a&gt; illustrated here.&lt;/p&gt;

&lt;p&gt;You can learn more about the why and how behind this method &lt;a href="http://thesassway.com/beginner/how-to-structure-a-sass-project"&gt;here&lt;/a&gt; (TheSassWay.com).&lt;/p&gt;
&lt;h2&gt;
  
  
  Issues
&lt;/h2&gt;

&lt;p&gt;Since the gulpfile is originally set up to only watch .scss files that are in the scss folder, the files in the partials and variables subfolders will not be watched, and changes won’t trigger a reload or compilation.&lt;/p&gt;

&lt;p&gt;Another thing about the tutorial’s gulpfile is that it doesn’t reload the browser whenever we make changes to our scss files. It simply watches and compiles, but will only reload if you make changes to the .html files.&lt;/p&gt;
&lt;h2&gt;
  
  
  Making it work
&lt;/h2&gt;

&lt;p&gt;In order to make BrowserSync and Gulp work for our scenario, I’ll need to make some minor tweaks. Take a look below. The changes are marked in bold and colored blue. You can copy this file further below in the article, where I’ve linked a gist.&lt;/p&gt;

&lt;p&gt;Take note of lines 8, 23, and 24.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lcEVq3Nm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2vgj0a6jl1puetjn0njx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lcEVq3Nm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2vgj0a6jl1puetjn0njx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How does it work?
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Defining the source files properly
&lt;/h3&gt;

&lt;p&gt;On lines 8 and 23, I’ve added extra syntax to allow for subfolder support. Instead of…&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/scss/*.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;… which only makes gulp watch .scss files that are direct children of the scss folder, we’re putting in an extra layer, like so …&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/scss/**/*.scss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;… which would then take subfolders and its contents in consideration. This (to my delight) is called Globbing, and you can read more about it &lt;a href="https://css-tricks.com/gulp-for-beginners/#globbing-in-node"&gt;here&lt;/a&gt; (CSS-Tricks.com).&lt;/p&gt;

&lt;p&gt;This solves our subfolder structure issue!&lt;/p&gt;
&lt;h3&gt;
  
  
  Setting up browser reload on scss change
&lt;/h3&gt;

&lt;p&gt;On line 24, I added the function^ below to the gulp watch task on lines 22–23.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.on("change", browserSync.reload);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The whole task would like like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gulp.watch("app/scss/**/*.scss", gulp.series("sass"))
.on("change", browserSync.reload);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This would force a reload whenever there are changes in any scss files.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;^I’m not entirely sure if that’s what we call that. Let me know what the proper name is, please?&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Your turn!
&lt;/h2&gt;

&lt;p&gt;Have a look at the whole copy-able gist file below and give it a try. Run &lt;code&gt;gulp-server&lt;/code&gt; and make changes to your .scss partials and see what happens.&lt;/p&gt;

&lt;p&gt;I like to test by changing my font color to a really obnoxious color just to see if it works :)&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;That’s it! I hope you found this useful. If you’ve got a better solution, let me know! I’d love to learn from you.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.frontendmentor.io/"&gt;Frontend Mentor&lt;/a&gt; — Build your portfolio with briefs, style guides, and even a pixel checker.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://themesberg.com/blog/tutorial/gulp-4-bootstrap-sass-browsersync"&gt;How to set up Gulp 4, Bootstrap, Sass and BrowserSync&lt;/a&gt; for a simple workflow (&lt;a href="https://twitter.com/zolidev"&gt;Zoltán Szőgyényi&lt;/a&gt;, Themesburg.com)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://css-tricks.com/gulp-for-beginners"&gt;Gulp for Beginners&lt;/a&gt; (&lt;a href="https://css-tricks.com/author/zellwk/"&gt;Zell Liew&lt;/a&gt;, CSS-Tricks.com)&lt;/li&gt;
&lt;li&gt;Create and share &lt;a href="https://carbon.now.sh/"&gt;beautiful images of your source code&lt;/a&gt; (Carbon.now.sh) I’m using the Duotone color scheme and Fira Code font.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>css</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
