<?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: Daniel Omehe</title>
    <description>The latest articles on DEV Community by Daniel Omehe (@danielomehe).</description>
    <link>https://dev.to/danielomehe</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%2F973977%2F117ad7ff-df2e-40e8-a09a-ef9d6e29a3d7.jpeg</url>
      <title>DEV Community: Daniel Omehe</title>
      <link>https://dev.to/danielomehe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danielomehe"/>
    <language>en</language>
    <item>
      <title>How to compile your SASS code to CSS from the command line</title>
      <dc:creator>Daniel Omehe</dc:creator>
      <pubDate>Thu, 16 Nov 2023 00:23:02 +0000</pubDate>
      <link>https://dev.to/danielomehe/how-to-compile-your-sass-code-to-css-from-the-command-line-4ln8</link>
      <guid>https://dev.to/danielomehe/how-to-compile-your-sass-code-to-css-from-the-command-line-4ln8</guid>
      <description>&lt;p&gt;Hello there&lt;/p&gt;

&lt;p&gt;In this tutorial, I'll share how to compile SCSS files to CSS using only the command line and no external compilers or task runners. Let's dive into it...&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;Table of content&lt;/u&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Compiling a single Sass file to CSS.&lt;/li&gt;
&lt;li&gt;Compiling multiple Sass files to CSS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;  This course requires you to have prior knowledge of HTML and at least intermediate knowledge as neither will be covered in this tutorial.&lt;/p&gt;

&lt;p&gt;Before we begin you need to have Nodejs and npm installed on your local computer, if you don't have Nodejs installed, install them here: &lt;a href="https://nodejs.org/en/download/current"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; NPM comes pre-installed with Nodejs so you don't need to install it separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Compiling a single Sass file to CSS.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WuSgWNYz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0og5hzlw419jo9ykwt0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WuSgWNYz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0og5hzlw419jo9ykwt0a.png" alt="subheading" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open the terminal on Vs code, to initialize npm in your local folder run: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm init -y&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates a package.json file that contains information about your project. &lt;/p&gt;

&lt;p&gt;Once NPM is initialized install Sass globally on your local machine by typing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g sass&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once you've installed Sass globally check the version by typing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sass --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next, create a sass file, input.scss, open the terminal&lt;br&gt;
and run the following command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"sass input.scss output.css&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This starts the compiler which outputs the compiled sass code from into output.css. To watch for changes to your code and compile on saving the file add the watch flag to the command like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sass --watch input.scss output.css&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This creates a CSS file containing the compiled sass code.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Compiling multiple Sass files to CSS.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uXadJUSq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vmfme9p009uiany4pqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uXadJUSq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vmfme9p009uiany4pqh.png" alt="subheading" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suppose you're working on a large project that requires you to write a lot of style rules and writing all sass code in 1 file can be bulky you can split your code into multiple files and then compile them all at the same time. To do this create a folder named &lt;strong&gt;sass&lt;/strong&gt; or &lt;strong&gt;scss&lt;/strong&gt; in your project for storing all your sass files and then create a CSS folder where the compiled CSS code files will be stored. Then in your terminal run the following command &lt;/p&gt;

&lt;p&gt;&lt;code&gt;sass --watch scss:css/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This starts the compiler which compiles all sass files in the scss folder and outputs the compiled code into the CSS folder.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;Adios!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to host static sites on Github pages</title>
      <dc:creator>Daniel Omehe</dc:creator>
      <pubDate>Mon, 13 Nov 2023 23:42:02 +0000</pubDate>
      <link>https://dev.to/danielomehe/how-to-host-static-apps-on-github-pages-1464</link>
      <guid>https://dev.to/danielomehe/how-to-host-static-apps-on-github-pages-1464</guid>
      <description>&lt;p&gt;Finally finished your first project, you're so excited you want to show it to everyone but then you remember you don't know how to host a site online? Well this tutorial covers how to get you started with hosting static pages on GitHub pages. Let get into it. &lt;/p&gt;

&lt;p&gt;Prerequisites: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;CSS&lt;/li&gt;
&lt;li&gt;And, maybe some JavaScript&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This tutorial assumes you already know a bit of HTML and CSS. So i won't be addressing those in this tutorial.&lt;/p&gt;

&lt;p&gt;To get started you'll need to have git installed, if you don't already have git installed on your computer you can get it here:  &lt;a href="https://git-scm.com/"&gt;https://git-scm.com/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Next, create a folder and add an HTML and CSS files. I'll be creating a simple application with just a loading spinner animation. Copy and paste the following code in your local file: &lt;/p&gt;

&lt;p&gt;Index.html&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;!Doctype html&amp;gt;
   &amp;lt;html lang="en"&amp;gt;
     &amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;Git And Sass practice&amp;lt;/title&amp;gt;
        &amp;lt;link rel="stylesheet" href="./css/styles.css" /&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div class="loading"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Styles.css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: red;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

h1 {
  color: white;
  font-size: 5rem;
  text-align: center;
}

.loading {
  width: 100px;
  height: 100px;
  border: 5px solid #fff;
  animation: spin 2s linear infinite;
  position: relative;
}

.loading::before {
  content: "";
  width: 100%;
  height: 100%;
  border: 5px solid #fff;
  position: absolute;
  left: -0.3rem;
  top: -0.3rem;
  animation: spinbefore 2s linear infinite;
}
.loading::after {
  content: "";
  width: 100%;
  height: 100%;
  border: 5px solid #fff;
  position: absolute;
  left: -0.3rem;
  top: -0.3rem;
  animation: spinafter 2s linear infinite;
}

@keyframes spin {
  50% {
    transform: rotate(360deg);
  }
}

@keyframes spinbefore {
  50% {
    transform: rotate(30deg);
  }
}

@keyframes spinafter {
  50% {
    transform: rotate(60deg);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that done, open your browser and visit the GitHub official website, follow the steps to create an account if you do not have one already, i won't be covering that in this tutorial. &lt;/p&gt;

&lt;p&gt;If you already have an account login, once that is done it takes you to your this page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MM3NYsNj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsvro25tcho0nnq5fxks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MM3NYsNj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsvro25tcho0nnq5fxks.png" alt="Image description" width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on new on the left sidebar to create a new repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--97X0X8hl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bp013rp6d2wmzkvvfhy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--97X0X8hl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bp013rp6d2wmzkvvfhy2.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next page enter your repo name, click on add Readme and then click on create repository to finish creating your repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LdgDflpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ctsxzguqokwjrfn4i458.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LdgDflpP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ctsxzguqokwjrfn4i458.png" alt="Image description" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Voila! you just completed the first step to hosting you site. Here is what your repo looks like for a start but as you make changes and push it is bound to reflect all the files from your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zJnkQbAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kn7nlzvjqqeueextftlu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zJnkQbAf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kn7nlzvjqqeueextftlu.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to connect the remote repo to your local repo, open git bash/cmd on windows and terminal on mac. I prefer to use terminal from my vs code editor that way i don't have to leave my editor.&lt;/p&gt;

&lt;p&gt;Open terminal and run &lt;strong&gt;git init&lt;/strong&gt; to initialize an empty git repo in the folder you already have open. Then open GitHub and on the new repo click on the green code button and copy the repo url.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VkLgs9xT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ewipgyfkuwdbbyrqsv8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VkLgs9xT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ewipgyfkuwdbbyrqsv8.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to connect the local repo to the remote repo you can either run &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git clone&lt;/strong&gt; to create a local close of your repo&lt;/p&gt;

&lt;p&gt;or &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git remote add origin [the-repo-url-you-copied]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and then run to pull and merge all files in the remote repo with those in the local one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git pull origin main&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, run &lt;strong&gt;git add .&lt;/strong&gt; to add all files in the to the staging area&lt;/p&gt;

&lt;p&gt;and then run &lt;strong&gt;git commit -m "your-commit-message"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and then run &lt;strong&gt;git push origin main&lt;/strong&gt; to push all changes to your remote repo.&lt;/p&gt;

&lt;p&gt;Then, open GitHub and go to the settings tab, click on the pages tab on the left sidebar&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ewZiJCbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqevoktcn029n3g6ro8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ewZiJCbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqevoktcn029n3g6ro8u.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the pages tab select deploy from a branch, a little further down select the branch to deploy from and click save&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3aseM2t_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2izxz7dhxaf2nra5jih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3aseM2t_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2izxz7dhxaf2nra5jih.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And like that your site is live after a few minutes reload page and click visit site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UBmnOa8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0y94hz2lw07e9bwlrb4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UBmnOa8r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0y94hz2lw07e9bwlrb4.png" alt="Image description" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading. &lt;/p&gt;

&lt;p&gt;Live version of my local example: &lt;a href="https://danielomehe.github.io/sass-compile/"&gt;https://danielomehe.github.io/sass-compile/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
