<?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: Syed Faateh Sultan Kazmi</title>
    <description>The latest articles on DEV Community by Syed Faateh Sultan Kazmi (@faatehsultan).</description>
    <link>https://dev.to/faatehsultan</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%2F447524%2Fadda4c71-3bb8-492d-8689-e5b52f9e3b5b.jpeg</url>
      <title>DEV Community: Syed Faateh Sultan Kazmi</title>
      <link>https://dev.to/faatehsultan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/faatehsultan"/>
    <language>en</language>
    <item>
      <title>I completed Hacktoberfest 2020 challenge</title>
      <dc:creator>Syed Faateh Sultan Kazmi</dc:creator>
      <pubDate>Sat, 17 Oct 2020 02:41:37 +0000</pubDate>
      <link>https://dev.to/faatehsultan/i-completed-hacktoberfest-2020-challenge-2b21</link>
      <guid>https://dev.to/faatehsultan/i-completed-hacktoberfest-2020-challenge-2b21</guid>
      <description>&lt;h2&gt;
  
  
  What I Learned From Hacktoberfest
&lt;/h2&gt;

&lt;p&gt;I completed Hacktoberfest 2020 challenge by making 4 contributions to different Github repositories and all of those 4 pull requests got accepted.&lt;br&gt;
I learned from hacktoberfest that open source is actually powering the software of the world. The best part of open source is that any developer can contribute which makes it exciting to have all those unique ideas together.&lt;/p&gt;

&lt;p&gt;It was a great experience to contribute to open-source :)&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>My Unique Project - Github Graph Magician</title>
      <dc:creator>Syed Faateh Sultan Kazmi</dc:creator>
      <pubDate>Wed, 02 Sep 2020 08:09:55 +0000</pubDate>
      <link>https://dev.to/faatehsultan/my-unique-project-github-graph-magician-3059</link>
      <guid>https://dev.to/faatehsultan/my-unique-project-github-graph-magician-3059</guid>
      <description>&lt;p&gt;Here is an exciting new update! 😀&lt;/p&gt;

&lt;h3&gt;
  
  
  The GitHub Contribution Graph
&lt;/h3&gt;

&lt;p&gt;All those folks using GitHub, know that there is a &lt;strong&gt;Contribution Graph&lt;/strong&gt; in GitHub that represent the statistics of the user's contributions over the past year in a Graphical Design so that it colors the date of contribution. That's cool, right?&lt;/p&gt;

&lt;p&gt;So, what I have developed?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://faatehsultan.github.io/github-graph-magician"&gt;GitHub Graph Magician&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ever wanted to design your contribution graph yourself? That sounds pretty awesome 😎. I have developed a unique tool, that you can use to design any pattern on your GitHub Contribution Graph, without knowing any technicalities behind the curtain!&lt;/p&gt;

&lt;p&gt;Here is a quick walkthrough about how to use this tool&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, install &lt;a href="https://nodejs.org/en/download/"&gt;Node JS&lt;/a&gt; on your PC as per your operating system.&lt;/li&gt;
&lt;li&gt;Go to &lt;a href="https://faatehsultan.github.io/github-graph-magician"&gt;GitHub Graph Magician (developed by me 😁)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Follow the instruction mentioned on the website
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F41k8uit2iv6ga7tn8m23.jpg" alt="Alt Text" width="800" height="391"&gt;
&lt;/li&gt;
&lt;li&gt;and SEE THE MAGIC HAPPEN! 😍😍😍&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;P.S.: This website works on screens greater than 695px. This means that you won't be able to use it on your mobile phones (also not intended for 😂)&lt;/p&gt;

&lt;p&gt;Remember me in your prayers!&lt;/p&gt;

&lt;p&gt;Allah Hafiz!&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>vscode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The easiest way to add a light/dark theme to your website</title>
      <dc:creator>Syed Faateh Sultan Kazmi</dc:creator>
      <pubDate>Sun, 30 Aug 2020 11:18:40 +0000</pubDate>
      <link>https://dev.to/faatehsultan/the-easiest-way-to-add-a-light-dark-theme-to-your-website-3o8j</link>
      <guid>https://dev.to/faatehsultan/the-easiest-way-to-add-a-light-dark-theme-to-your-website-3o8j</guid>
      <description>&lt;p&gt;Hi, hope you guys are doing good 😀&lt;/p&gt;

&lt;p&gt;As we know, &lt;strong&gt;The Dark Mode&lt;/strong&gt; Themes are trending nowadays. Whether its a mobile app, website, PC app, or anything, everyone shows great interest in Dark Themes.&lt;/p&gt;

&lt;p&gt;Similarly, web designers and web developers are also working to add dark mode feature on their projects as well. Most of the big brands like Facebook, WhatsApp, Instagram, Google Chrome and many other platforms have introduced dark modes and users have appreciated a lot.&lt;/p&gt;

&lt;p&gt;So, I will share a very basic and straight-forward technique using basic CSS and JS that can be used by beginner to advanced developers to add dark mode to there website.&lt;/p&gt;

&lt;h2&gt;
  
  
  The power of CSS Variables
&lt;/h2&gt;

&lt;p&gt;First of all, lets discuss about color schemes. It is a very good practice in CSS to create variables in &lt;strong&gt;&lt;em&gt;:root&lt;/em&gt;&lt;/strong&gt; for each and every color you have used in your stylesheet. You can use those colors by referring to corresponding variables instead of copying color codes everywhere. Also, if you have to change color, just change the variable's value. So, first, any color you have in your stylesheet, create a variable for that. You can learn CSS Variables on &lt;a href="https://www.w3schools.com/css/css3_variables.asp"&gt;W3Schools&lt;/a&gt; or &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties"&gt;Mozilla Dev Network&lt;/a&gt;. Remember, if you want to switch any colors (e.g. light/dark themes), separately create currently used variables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/*Global color pallete*/&lt;/span&gt;
    &lt;span class="py"&gt;--light-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--light-foreground-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#341f97&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--dark-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--dark-foreground-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#48dbfb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c"&gt;/*Currently used*/&lt;/span&gt;
    &lt;span class="py"&gt;--cur-bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--light-background-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--cur-fg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--light-foreground-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Manipulating Stylesheets using JS
&lt;/h2&gt;

&lt;p&gt;When you are done with styling the default theme colors, use Javascript to directly modify the stylesheet. Use the following scheme.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define the :root for both dark and light themes in JS for convenience.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:root { --light-background-color: #ffffff; --light-foreground-color: #341f97; --dark-background-color: #000000; --dark-foreground-color: #48dbfb; --cur-bg: var(--light-background-color); --cur-fg: var(--light-foreground-color);}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;darkThemeRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:root { --light-background-color: #ffffff; --light-foreground-color: #341f97; --dark-background-color: #000000; --dark-foreground-color: #48dbfb; --cur-bg: var(--dark-background-color); --cur-fg: var(--dark-foreground-color);}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Find the &lt;em&gt;Stylesheet Index&lt;/em&gt; of the CSS file where you defined color variables to be used in switching themes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MY_CSS_FILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/css/style.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//store path to your css file here&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myFileIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stylesheets&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lengh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;MY_CSS_FILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;myFileIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;//now we have the file index i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Manipulate the :root of stylesheet to switch theme when a button is clicked.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;cssText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;removeRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insertRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;darkThemeRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;removeRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insertRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Finishing
&lt;/h2&gt;

&lt;p&gt;Finally, lets bring all this together so that you can better understand the scenario.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTML Element
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"switchTheme();"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Switch Theme&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  CSS Root
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/*Global color pallete*/&lt;/span&gt;
    &lt;span class="py"&gt;--light-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--light-foreground-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#341f97&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--dark-background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="py"&gt;--dark-foreground-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#48dbfb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c"&gt;/*Currently used*/&lt;/span&gt;
    &lt;span class="py"&gt;--cur-bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--light-background-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="py"&gt;--cur-fg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--light-foreground-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  JS Method
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;switchTheme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//remember to change these variables if you change the :root in CSS&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:root { --light-background-color: #ffffff; --light-foreground-color: #341f97; --dark-background-color: #000000; --dark-foreground-color: #48dbfb; --cur-bg: var(--light-background-color); --cur-fg: var(--light-foreground-color);}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;darkThemeRoot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;:root { --light-background-color: #ffffff; --light-foreground-color: #341f97; --dark-background-color: #000000; --dark-foreground-color: #48dbfb; --cur-bg: var(--dark-background-color); --cur-fg: var(--dark-foreground-color);}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


    &lt;span class="c1"&gt;//switching scheme&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MY_CSS_FILE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/css/style.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//store path to your css file here&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myFileIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stylesheets&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lengh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;MY_CSS_FILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;myFileIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;cssText&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;removeRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insertRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;darkThemeRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;removeRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;:root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;ALL_CSS_FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;item&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;myFileIndex&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insertRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lightThemeRoot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;There are a lot of different methods to achieve the dark theme. But here I have shared the most straight-forward and basic method to do this. So, tell me in comments, which method do you use and prefer for applying the dark theme in website!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How powerful are the regular expressions for faster coding</title>
      <dc:creator>Syed Faateh Sultan Kazmi</dc:creator>
      <pubDate>Tue, 18 Aug 2020 15:38:44 +0000</pubDate>
      <link>https://dev.to/faatehsultan/how-powerful-are-the-regular-expressions-for-faster-coding-48d1</link>
      <guid>https://dev.to/faatehsultan/how-powerful-are-the-regular-expressions-for-faster-coding-48d1</guid>
      <description>&lt;p&gt;Do you know about a technique that can speed up your coding experience for almost all the code editors in the world?&lt;/p&gt;

&lt;h1&gt;
  
  
  Code Editors, the long debate 😁
&lt;/h1&gt;

&lt;p&gt;Choosing a code editor is a long (and never-ending) debate though. The choice of code editor totally depends on your needs as well as your comfort. There is no &lt;em&gt;perfect for all&lt;/em&gt; code editor. The one that you prefer, may not be a good option for someone else. So, explore multiple code editors to find your favorite one. (Remember, I'm talking about code editors, not IDEs 😑). Some of the top trending GUI code editors today are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://code.visualstudio.com"&gt;&lt;strong&gt;Visual Studio Code&lt;/strong&gt;&lt;/a&gt; by Microsoft&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://atom.io"&gt;&lt;strong&gt;Atom&lt;/strong&gt;&lt;/a&gt; by GitHub&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.sublimetext.com"&gt;&lt;strong&gt;Sublime Text&lt;/strong&gt;&lt;/a&gt; by John Skinner&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://brackets.io"&gt;&lt;strong&gt;Brackets&lt;/strong&gt;&lt;/a&gt; by Adobe&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also, there are some CLI code editors like &lt;em&gt;Vim&lt;/em&gt; and &lt;em&gt;Nano&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;But all GUI editors have one common feature!&lt;/p&gt;

&lt;h1&gt;
  
  
  Regular Expressions in Code Editors
&lt;/h1&gt;

&lt;p&gt;Most of the time, especially when modifying a previously written code. We all use &lt;em&gt;Find&lt;/em&gt; (&lt;em&gt;CTRL+F&lt;/em&gt;) and &lt;em&gt;Replace&lt;/em&gt; (&lt;em&gt;CTRL+H&lt;/em&gt;) features to search a previously coded module, features, variable, or method. Although this feature is very good, &lt;strong&gt;Regular Expressions&lt;/strong&gt; can increase their productivity up to a great extent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage of RE in Code Editors
&lt;/h2&gt;

&lt;p&gt;I personally use the Visual Studio Code. So, I'll illustrate 3 very basic examples of using regular expressions to search for specific content in the codebase.&lt;br&gt;
*Note that you must turn on RE feature as shown in the image below:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foxodo6nkwg3nj58csxmi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foxodo6nkwg3nj58csxmi.png" alt="RE Demo 0" width="515" height="76"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Match any single character (except a line break)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3nujlvkjsuro1zjxkff6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3nujlvkjsuro1zjxkff6.png" alt="RE Demo 1" width="516" height="68"&gt;&lt;/a&gt;&lt;br&gt;
can match any sequence such as &lt;code&gt;cms&lt;/code&gt;, &lt;code&gt;crm&lt;/code&gt;, or &lt;code&gt;c3s&lt;/code&gt; etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Match multiple characters
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1vj0q787j8pncug57sw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1vj0q787j8pncug57sw8.png" alt="RE Demo 2" width="517" height="72"&gt;&lt;/a&gt;&lt;br&gt;
can match any sequence such as &lt;code&gt;cases&lt;/code&gt;, &lt;code&gt;comes&lt;/code&gt;, &lt;code&gt;c43s&lt;/code&gt; etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Match at the beginning of a sentence
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn6mf3ia0ovt8te3p8tjz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn6mf3ia0ovt8te3p8tjz.png" alt="Alt Text" width="525" height="73"&gt;&lt;/a&gt;&lt;br&gt;
can match all the lines starting with &lt;code&gt;user&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are many more ways to use Regular Expressions for searching the codebase.&lt;/p&gt;

&lt;p&gt;You can find Regular Expression usage in &lt;a href="https://docs.microsoft.com/en-us/visualstudio/ide/using-regular-expressions-in-visual-studio"&gt;Visual Studio Code and Visual Studio IDE&lt;/a&gt;. If you are using some other editor, google its docs!&lt;/p&gt;

&lt;p&gt;Hope you like this! 😉&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>vscode</category>
      <category>showdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How I developed a commercial website for a client using front-end technologies</title>
      <dc:creator>Syed Faateh Sultan Kazmi</dc:creator>
      <pubDate>Wed, 05 Aug 2020 20:05:01 +0000</pubDate>
      <link>https://dev.to/faatehsultan/i-developed-a-commercial-website-for-my-client-s-business-52c1</link>
      <guid>https://dev.to/faatehsultan/i-developed-a-commercial-website-for-my-client-s-business-52c1</guid>
      <description>&lt;p&gt;Last month, I got a call from one of my friends who told me that the owner of this company &lt;strong&gt;Allahdin Casting Foundry&lt;/strong&gt; needs a good, responsive website for his business.&lt;/p&gt;

&lt;p&gt;I'll be sharing my experience on how I developed a fully responsive website using just HTML, CSS, JS, and Bootstrap 4. As a beginner, most of the developers start coding after just a few details and when the scope broadens, they need to shift technology. So, these are the steps in which I completed this project (in the 4th semester of my BS Computer Science degree). I followed the software engineering principles in this project and I can say that they helped a lot. 😊&lt;/p&gt;

&lt;h1&gt;
  
  
  Communication
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Project Initiation
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A fully responsive business website for a casting foundry&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Requirement Elicitation
&lt;/h3&gt;

&lt;p&gt;I met the person for a detailed discussion about the project. It was a completely static and responsive website project. I had to work only on the front-end. During the communication with the client, I focused on the requirement gathering to prepare a reliable software process model to work on. &lt;/p&gt;

&lt;h1&gt;
  
  
  Planning
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Cost Estimation
&lt;/h3&gt;

&lt;p&gt;Considering the client's requirements, I estimated the cost as per the technology used in terms of webpages and design and finally presented it to the client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scheduling
&lt;/h3&gt;

&lt;p&gt;After the cost agreement, I scheduled the project to be completed within one week.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tracking
&lt;/h3&gt;

&lt;p&gt;To track and control the development process, I used the &lt;em&gt;Git&lt;/em&gt; version control system to commit the project after developing each feature. It helped a lot to backtrack when there was a mistake.&lt;/p&gt;

&lt;h1&gt;
  
  
  Preparing the Software Process Model
&lt;/h1&gt;

&lt;p&gt;The vision was clear. It was a small scale project, so there was no such need for a definite software process model. But, in order to keep everything confined and use good practices, I followed an &lt;strong&gt;Iterative Software Process&lt;/strong&gt; Model. I prepared drafts about the software project model and started working.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prototyping
&lt;/h1&gt;

&lt;p&gt;I prepared a robust structure of the website along with the UI design and sent it to the client as a prototype. For this purpose, I used a repository on my own GitHub.&lt;/p&gt;

&lt;h1&gt;
  
  
  Technology and Platform to be used
&lt;/h1&gt;

&lt;p&gt;Collectively, I used HTML, CSS, Javascript, Bootstrap 4, and Jquery for front-end along with Google Maps API and Google Forms Integration. I created a project on &lt;strong&gt;Google Firebase&lt;/strong&gt; hosting to deploy this site. I bought a .com domain from &lt;strong&gt;Porkbun&lt;/strong&gt;. I also designed the logos and other image assets, privacy policy, and T&amp;amp;C also.&lt;br&gt;
P.S. I use VS Code 😎&lt;/p&gt;

&lt;h1&gt;
  
  
  Project Construction
&lt;/h1&gt;

&lt;p&gt;After the prototypes were accepted, I started working on the main project. I developed the structure and layout of the website and made is responsive using various media queries. After that, I applied images, assets, and styling to make the site user friendly. Next, I developed some client-side programming in JS to make features functional. Finally, I completed the dynamics of the website. It took me about a week to get the project completed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Testing Phase
&lt;/h1&gt;

&lt;p&gt;After completion, I tested the site myself. I focused on the following things to test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All the links should refer to correct location&lt;/li&gt;
&lt;li&gt;There should be no typo at all&lt;/li&gt;
&lt;li&gt;Most importantly, the loading &lt;strong&gt;speed&lt;/strong&gt; should be reliable (used 
&lt;a href="https://developers.google.com/speed/pagespeed/insights/"&gt;Google Pagespeed Insights&lt;/a&gt; and other tests for this)&lt;/li&gt;
&lt;li&gt;Website should look great on all devices (screen sizes)&lt;/li&gt;
&lt;li&gt;Images must be properly sized&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, I released the beta testing version of the site for the public for about 4-5 days. Obviously, some bugs/issues were there which I rectified.&lt;/p&gt;

&lt;h1&gt;
  
  
  Deployment
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Final Release
&lt;/h2&gt;

&lt;p&gt;After complete testing, I released the final version 1.0.1 (current version is 1.0.3). I also created two emails &lt;em&gt;(see on the website 😁)&lt;/em&gt; forwarding systems to incorporate a sophisticated environment for visitors to interact with.&lt;/p&gt;

&lt;p&gt;This is how within two weeks, the website was up and running.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Product
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.allahdincastingfoundry.com"&gt;Allahdin Casting Foundry&lt;/a&gt; is the final website.&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;If found any bug/issue, please report to me or email &lt;a href="mailto:webmaster@allahdincastingfoundry.com"&gt;webmaster@allahdincastingfoundry.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Feedback
&lt;/h3&gt;

&lt;p&gt;The client's feedback on this project was awesome. 😉&lt;/p&gt;

&lt;p&gt;Finally, I created a Google Business and did some SEO to index the site on search engines.&lt;/p&gt;

&lt;p&gt;So, this is how I developed a fully responsive static website for a client 🙂&lt;/p&gt;

&lt;p&gt;P.S.: I've done a commercial project back in 2015 (now inactive). But this one was a much more mature and robust project.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
