<?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: Ahmad</title>
    <description>The latest articles on DEV Community by Ahmad (@ahmadherzallah).</description>
    <link>https://dev.to/ahmadherzallah</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%2F179351%2F47038f17-0f68-468f-8215-0afbb0837195.jpg</url>
      <title>DEV Community: Ahmad</title>
      <link>https://dev.to/ahmadherzallah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmadherzallah"/>
    <language>en</language>
    <item>
      <title>My Hacktoberfest Experience</title>
      <dc:creator>Ahmad</dc:creator>
      <pubDate>Fri, 06 Nov 2020 06:01:32 +0000</pubDate>
      <link>https://dev.to/ahmadherzallah/my-hacktoberfest-experience-1e50</link>
      <guid>https://dev.to/ahmadherzallah/my-hacktoberfest-experience-1e50</guid>
      <description>&lt;h3&gt;
  
  
  [Intro Heading]
&lt;/h3&gt;

&lt;p&gt;Hello 😁, I joined DEV Community to share some of my works and learn from others, and I learned a lot from articles. Cause I can read it anytime &amp;amp; anywhere&lt;/p&gt;

&lt;h3&gt;
  
  
  Background
&lt;/h3&gt;

&lt;p&gt;Now I finished my 4 pull requests and got accepted, and I got a Huge experience in this journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contributions
&lt;/h3&gt;

&lt;p&gt;I participated in open-source projects such as:&lt;br&gt;
&lt;a href="https://github.com/c0sm0void/ProjectMRU"&gt;https://github.com/c0sm0void/ProjectMRU&lt;/a&gt;&lt;br&gt;
I participated in c0sm0void/ProjectMRU so I can share my experience with other people, and help people if they got a problem or a question in their code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reflections
&lt;/h3&gt;

&lt;p&gt;I really enjoyed working on open-source projects, and I'll participate again 😁&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Theme Selector</title>
      <dc:creator>Ahmad</dc:creator>
      <pubDate>Wed, 12 Jun 2019 06:21:38 +0000</pubDate>
      <link>https://dev.to/ahmadherzallah/theme-selector-594p</link>
      <guid>https://dev.to/ahmadherzallah/theme-selector-594p</guid>
      <description>&lt;p&gt;Well, Today I'll show you how to make " Theme Selector " &lt;/p&gt;

&lt;p&gt;Result:         &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tJ3diXJG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dl.dropboxusercontent.com/s/kv5f9g52apfs6cq/ktIcIsyNdX.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tJ3diXJG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dl.dropboxusercontent.com/s/kv5f9g52apfs6cq/ktIcIsyNdX.gif" alt="Theme Selector"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Add jQuery
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;jQuery&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  add Themes btns
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--onciQu3t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IDpD5U" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--onciQu3t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IDpD5U" alt="btn"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So how we can add it, and how much?&lt;/p&gt;

&lt;p&gt;as much as you want, if you want to add 3 btns u can.&lt;/p&gt;

&lt;p&gt;go to &lt;code&gt;index.html&lt;/code&gt; and add  &lt;code&gt;ul&lt;/code&gt; with class &lt;code&gt;switch-color&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;.then : inside the &lt;code&gt;ul&lt;/code&gt; tag.&lt;br&gt;
add as much as you want &lt;code&gt;li&lt;/code&gt; tag, with attribute &lt;code&gt;data-color&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;li data-color="COLOR"&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;How We'll use it?&lt;br&gt;
well, for example: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bwmzgjqP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IEL1YR" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bwmzgjqP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IEL1YR" alt="ul li"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll get this: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FB6rLVDT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IEk8E8" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FB6rLVDT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IEk8E8" alt="lis"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, now we have to add CSS&lt;/p&gt;
&lt;h1&gt;
  
  
  CSS
&lt;/h1&gt;

&lt;p&gt;First, we will add &lt;code&gt;:root&lt;/code&gt; that it will change when we click the theme btns&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:root {&lt;br&gt;
  --maincolor: #080; // Original Theme&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Quick CSS code&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.switch-color li {&lt;br&gt;
  display: inline-block;&lt;br&gt;
  width: 20px;&lt;br&gt;
  height: 20px;&lt;br&gt;
  cursor: pointer;&lt;br&gt;
  transition: 0.5s;&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;and then style for the &lt;code&gt;li&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.switch-color li:first-child {&lt;br&gt;
  background-color: #b71540;&lt;br&gt;
  color: white;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(2) {&lt;br&gt;
  background-color: #0c2461;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(3) {&lt;br&gt;
  background-color: #3c6382;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(4) {&lt;br&gt;
  background-color: #079992;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(5) {&lt;br&gt;
  background-color: #e58e26;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(6) {&lt;br&gt;
  background-color: #8e44ad;&lt;br&gt;
}&lt;br&gt;
.switch-color li:nth-child(7) {&lt;br&gt;
  background-color: #2c3e50;&lt;br&gt;
  color: black;&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Result: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NCnBRJRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IA6LVv" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NCnBRJRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IA6LVv" alt="result"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we want some content to test the btns.&lt;/p&gt;

&lt;h1&gt;
  
  
  Content
&lt;/h1&gt;

&lt;p&gt;Soo quick code HTML &amp;amp; CSS for Content&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HTML&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;div class="main"&amp;gt;&lt;br&gt;
        &amp;lt;h2&amp;gt;Title&amp;lt;/h2&amp;gt;&lt;br&gt;
        &amp;lt;div class="main-content"&amp;gt;&lt;br&gt;
            Content&lt;br&gt;
        &amp;lt;/div&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  CSS
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;main h2 {&lt;br&gt;
  color: var(--maincolor); // From =&amp;gt; :root&lt;br&gt;
} &lt;br&gt;
 .main-content {&lt;br&gt;
  background-color: var(--maincolor); // From =&amp;gt; :root&lt;br&gt;
  color: #fff;&lt;br&gt;
  padding: 20px;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Result: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WF1c7jml--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IzuchV" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WF1c7jml--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://bit.ly/2IzuchV" alt="Ressult"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  JavaScript
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;$(function() {&lt;br&gt;
  $(".switch-color li").on("click", function() {&lt;br&gt;
    $(":root").css("--maincolor", $(this).data("color"));&lt;br&gt;
  });&lt;br&gt;
});&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Explain: in click one of ul items. it will change --maincolor in :root to the data from the clicked li.&lt;/p&gt;

&lt;p&gt;That's it :)&lt;/p&gt;

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