<?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: Khawaja Khurram (MAK)</title>
    <description>The latest articles on DEV Community by Khawaja Khurram (MAK) (@khawaja_khurrammak_6ad).</description>
    <link>https://dev.to/khawaja_khurrammak_6ad</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3652121%2F51ab28ec-7922-45d1-aee6-e2b205ea9edf.jpg</url>
      <title>DEV Community: Khawaja Khurram (MAK)</title>
      <link>https://dev.to/khawaja_khurrammak_6ad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khawaja_khurrammak_6ad"/>
    <language>en</language>
    <item>
      <title>Lesson 1.1: Building Your First Header</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Tue, 15 Sep 2026 14:08:09 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/lesson-11-building-your-first-header-3f5e</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/lesson-11-building-your-first-header-3f5e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📚 &lt;em&gt;This article was originally published on &lt;a href="https://makuistudio.com/courses/html/quest1/lesson1.html" rel="noopener noreferrer"&gt;MAK Studio&lt;/a&gt;. Check out the full interactive lesson with live demos and code examples.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Quest 1 • Lesson 1
&lt;/h2&gt;

&lt;h1&gt;
  
  
  Building Your First Header
&lt;/h1&gt;

&lt;p&gt;Think of HTML as the skeleton of a house.&lt;br&gt;
Before we paint the walls (CSS), we need to put up the structure.&lt;/p&gt;

&lt;p&gt;"Every web page starts with a simple set of tags that tell the browser what is a header and what is a paragraph."&lt;/p&gt;

&lt;p&gt;index.html&lt;/p&gt;

&lt;h1&gt;Hello World&lt;/h1&gt; 

&lt;p&gt;This is my first web page.&lt;/p&gt;
&lt;h3&gt;
  
  
  🧠 Understanding the Tags
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; – Heading level 1 (the most important heading).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;/h1&amp;gt;&lt;/code&gt; – Closing tag for the heading.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; – Paragraph tag.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt; – Closing tag for the paragraph.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most HTML elements have an opening tag &lt;code&gt;&amp;lt;tag&amp;gt;&lt;/code&gt; and a closing tag &lt;code&gt;&amp;lt;/tag&amp;gt;&lt;/code&gt;. The content goes in between.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✨ Challenge: Create Your Own Header
&lt;/h3&gt;

&lt;p&gt;Change the text inside the &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; to your name, and the paragraph to a short introduction.&lt;br&gt;
&lt;/p&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;h1&amp;gt;&lt;/span&gt;Your Name Here&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I'm learning HTML and this is my first page!&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📋 Copy Code&lt;/p&gt;

&lt;h3&gt;
  
  
  ❤️ Support Free Education
&lt;/h3&gt;

&lt;p&gt;This course is 100% free. If it helps you, consider buying me a coffee.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/uilearningbymak" rel="noopener noreferrer"&gt;☕ Buy Me a Coffee&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ➡️ Ready for more?
&lt;/h3&gt;

&lt;p&gt;Next lesson: Links &amp;amp; Navigation – connect pages together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://makuistudio.com/courses/html/quest1/lesson2.html" rel="noopener noreferrer"&gt;Continue to Lesson 1.2 →&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Coming soon – check back or buy Pro Pack for instant access)&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Want more free lessons?
&lt;/h3&gt;

&lt;p&gt;This is part of a &lt;strong&gt;free 30+ lesson curriculum&lt;/strong&gt; on &lt;a href="https://makuistudio.com/courses/index.html" rel="noopener noreferrer"&gt;HTML, Python, AI, and JavaScript&lt;/a&gt;. No sign-up. No ads. Just code.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://makuistudio.com/courses/index.html" rel="noopener noreferrer"&gt;Start learning for free&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Python Lists vs Tuples</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Tue, 15 Sep 2026 13:57:16 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/python-lists-vs-tuples-3nm7</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/python-lists-vs-tuples-3nm7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;📚 &lt;em&gt;This article was originally published on &lt;a href="https://makuistudio.com/courses/python/quest1/lesson3.html" rel="noopener noreferrer"&gt;MAK Studio&lt;/a&gt;. Check out the full interactive lesson with live demos and code examples.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Quest 1 • Lesson 3
&lt;/h2&gt;

&lt;h1&gt;
  
  
  📦 Lists &amp;amp; Tuples
&lt;/h1&gt;

&lt;p&gt;Store, organise, and manipulate collections of data – understand when to use lists vs tuples.&lt;/p&gt;

&lt;p&gt;A list is a collection of items that can be changed (mutable). A tuple is like a list but cannot be changed (immutable). Both are fundamental for storing groups of data.&lt;/p&gt;

&lt;p&gt;"Lists are great for to‑do lists – you can add, remove, or modify tasks. Tuples are for fixed data, like days of the week."&lt;/p&gt;

&lt;p&gt;lists.py&lt;/p&gt;

&lt;p&gt;fruits = ["apple", "banana", "cherry"] &lt;br&gt;
mixed = [10, "hello", True, 3.14] &lt;/p&gt;

&lt;p&gt;print(fruits) # Output: ['apple', 'banana', 'cherry'] &lt;br&gt;
print(fruits[0]) # Output: apple&lt;/p&gt;
&lt;h3&gt;
  
  
  🧠 List Basics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lists are created with &lt;code&gt;[ ]&lt;/code&gt; (square brackets).&lt;/li&gt;
&lt;li&gt;Items are indexed starting from &lt;code&gt;0&lt;/code&gt; – first item is &lt;code&gt;fruits[0]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You can store different data types in one list.&lt;/li&gt;
&lt;li&gt;📚 Previously: You learned about &lt;a href="https://makuistudio.com/courses/python/quest1/lesson2.html" rel="noopener noreferrer"&gt;variables and data types in Lesson 1.2&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🛠️ Useful List Methods
&lt;/h3&gt;

&lt;p&gt;.append() – adds an item to the end.&lt;/p&gt;

&lt;p&gt;fruits.append("orange") # fruits now has 4 items&lt;/p&gt;

&lt;p&gt;.remove() – removes the first occurrence of an item.&lt;/p&gt;

&lt;p&gt;fruits.remove("banana")&lt;/p&gt;

&lt;p&gt;len() – returns the number of items.&lt;/p&gt;

&lt;p&gt;print(len(fruits)) # Output: 3&lt;/p&gt;

&lt;p&gt;.pop() – removes and returns the last item.&lt;/p&gt;

&lt;p&gt;last = fruits.pop() # removes and returns 'cherry'&lt;/p&gt;
&lt;h3&gt;
  
  
  📌 Tuples – Immutable Lists
&lt;/h3&gt;

&lt;p&gt;Tuples are created with &lt;code&gt;( )&lt;/code&gt; (parentheses). They cannot be changed after creation.&lt;/p&gt;

&lt;p&gt;days = ("Mon", "Tue", "Wed") &lt;br&gt;
coordinates = (10, 20) &lt;/p&gt;
&lt;h1&gt;
  
  
  days.append("Thu") would cause an error – tuples are immutable!
&lt;/h1&gt;

&lt;p&gt;Use tuples for data that should never change (e.g., weekdays, fixed settings).&lt;/p&gt;
&lt;h3&gt;
  
  
  ⚠️ Common Mistakes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;❌ Trying to change a tuple:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tuples are immutable – you cannot add, remove, or change items after creation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;days&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Mon&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Tue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sun&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;# ❌ TypeError: 'tuple' object does not support item assignment
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;❌ Forgetting that list indexing starts at 0:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first item in a list or tuple is at index 0, not 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;apple&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;banana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cherry&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fruits&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# "banana" – index 1 is the second item
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💡 Pro Tips
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Use lists for data that changes – tuples for fixed data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use lists when you need to add, remove, or update items. Use tuples for fixed data like days of the week, coordinates, or configuration settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use tuple unpacking for cleaner code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can unpack a tuple into multiple variables in one line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;coordinates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;coordinates&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 10
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 20
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨ Challenge: Build a Shopping List
&lt;/h3&gt;

&lt;p&gt;Create a list called &lt;code&gt;shopping&lt;/code&gt; with 3 items. Then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Append a fourth item.&lt;/li&gt;
&lt;li&gt;Remove the second item.&lt;/li&gt;
&lt;li&gt;Print the final list.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;📋 Copy Solution&lt;/p&gt;

&lt;p&gt;shopping = ["milk", "bread", "eggs"] &lt;br&gt;
shopping.append("butter") &lt;br&gt;
shopping.remove("bread") &lt;br&gt;
print(shopping) # ['milk', 'eggs', 'butter']&lt;/p&gt;

&lt;h3&gt;
  
  
  📚 What's Next?
&lt;/h3&gt;

&lt;p&gt;After mastering lists and tuples, you're ready to learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://makuistudio.com/courses/python/quest1/lesson4.html" rel="noopener noreferrer"&gt;Lesson 1.4: Conditional Statements →&lt;/a&gt; – make decisions with if/elif/else.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://makuistudio.com/courses/python/quest1/lesson5.html" rel="noopener noreferrer"&gt;Lesson 1.5: Loops →&lt;/a&gt; – repeat actions with for and while.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://makuistudio.com/ultimate-python-guide.html" rel="noopener noreferrer"&gt;📘 Ultimate Python Guide →&lt;/a&gt; – the complete beginner's resource.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📤 Share This Lesson
&lt;/h3&gt;

&lt;p&gt;Help others learn – share this lesson with your network!&lt;/p&gt;

&lt;p&gt;📋 Copy Link&lt;/p&gt;

&lt;h3&gt;
  
  
  ❤️ Support Free Education
&lt;/h3&gt;

&lt;p&gt;This course is 100% free. If it helps you, consider buying me a coffee.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ko-fi.com/yourusername" rel="noopener noreferrer"&gt;☕ Buy Me a Coffee&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🚀 Want more free lessons?
&lt;/h3&gt;

&lt;p&gt;This is part of a &lt;strong&gt;free 30+ lesson curriculum&lt;/strong&gt; on &lt;a href="https://makuistudio.com/courses/index.html" rel="noopener noreferrer"&gt;HTML, Python, AI, and JavaScript&lt;/a&gt;. No sign-up. No ads. Just code.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://makuistudio.com/courses/index.html" rel="noopener noreferrer"&gt;Start learning for free&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Built a Free Learning Platform with 30+ Lessons – Here's What I Learned</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Fri, 04 Sep 2026 16:00:45 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/i-built-a-free-learning-platform-with-30-lessons-heres-what-i-learned-4f7d</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/i-built-a-free-learning-platform-with-30-lessons-heres-what-i-learned-4f7d</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Idea&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I started 2025 with a simple question: "What if I could help absolute beginners learn to code without any barriers – no sign‑up, no ads, no paywalls?"&lt;/p&gt;

&lt;p&gt;I believe that everyone should have access to quality education, regardless of where they live or how much money they have. So I decided to build a free coding platform from scratch.&lt;/p&gt;

&lt;p&gt;It took me months, a lot of late nights, and plenty of frustration. But the result is something I'm truly proud of.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;What I Built&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I built &lt;a href="https://makuistudio.com" rel="noopener noreferrer"&gt;MAK UI Studio&lt;/a&gt; – a free learning platform with:&lt;/p&gt;

&lt;p&gt;📚 30+ Lessons Across 3 Courses&lt;/p&gt;

&lt;p&gt;Course Lessons Topics&lt;br&gt;
🌐 HTML &amp;amp; CSS 10 Lessons Headers, links, images, forms, CSS, Flexbox, Grid, Semantic HTML, Project&lt;/p&gt;

&lt;p&gt;🐍 Python 10 Lessons Variables, lists, conditionals, loops, functions, dictionaries, error handling, Calculator Project&lt;/p&gt;

&lt;p&gt;🤖 AI 10 Lessons ML, Neural Networks, Computer Vision, NLP, Transfer Learning, LLMs, Chatbot Project&lt;/p&gt;

&lt;p&gt;Each lesson includes:&lt;/p&gt;

&lt;p&gt;· Live code examples&lt;br&gt;
· Copy‑paste code blocks&lt;br&gt;
· Interactive demos (TensorFlow.js for AI)&lt;br&gt;
· Challenges to reinforce learning&lt;/p&gt;




&lt;p&gt;🧩 Free UI Snippets&lt;/p&gt;

&lt;p&gt;I also built a growing library of free UI snippets:&lt;/p&gt;

&lt;p&gt;· Animated Cards&lt;br&gt;
· Dropdown Menu&lt;br&gt;
· Password Generator&lt;br&gt;
· Sentiment Analyser (AI)&lt;br&gt;
· Image Classifier (AI)&lt;br&gt;
· And more…&lt;/p&gt;

&lt;p&gt;Developers can copy, paste, and customise them instantly.&lt;/p&gt;




&lt;p&gt;📘 Ultimate Guides&lt;/p&gt;

&lt;p&gt;I consolidated each course into a single, long‑form guide:&lt;/p&gt;

&lt;p&gt;· Ultimate HTML Guide&lt;br&gt;
· Ultimate Python Guide&lt;br&gt;
· Ultimate AI Guide&lt;/p&gt;

&lt;p&gt;These are perfect for learners who prefer a comprehensive reference.&lt;/p&gt;




&lt;p&gt;📱 YouTube Shorts&lt;/p&gt;

&lt;p&gt;I also started connecting my YouTube channel to the website:&lt;/p&gt;

&lt;p&gt;· HTML Shorts&lt;br&gt;
· Python Shorts&lt;br&gt;
· AI Shorts&lt;/p&gt;

&lt;h2&gt;
  
  
  Short, 60‑second tutorials that complement the written lessons.
&lt;/h2&gt;

&lt;p&gt;The Tech Stack&lt;/p&gt;

&lt;p&gt;I kept it simple and accessible:&lt;/p&gt;

&lt;p&gt;· Frontend: HTML, CSS, JavaScript&lt;br&gt;
· Hosting: GitHub Pages&lt;br&gt;
· AI: TensorFlow.js (in‑browser)&lt;br&gt;
· Domain: Custom domain (makuistudio.com)&lt;/p&gt;

&lt;p&gt;No backend, no databases, no complexity. Just pure static content that works for everyone.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What I Learned Along the Way&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;1. Start Simple, Then Expand&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I initially planned to include everything at once. That was a mistake. I started with HTML, then added Python, then AI. Each course informed the next.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;2. Interactive Demos Make a Difference&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Static lessons are good. Interactive demos are better. Students learn more when they can see the code running in real‑time.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;3. Consistency Is Everything&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I published one lesson per week. It kept me accountable and gave me a steady rhythm.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;4. Community Engagement Takes Time&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Traffic doesn't come overnight. I'm still working on backlinks, social sharing, and building an audience. But the foundation is solid.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;5. Feedback Is a Gift&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
Every comment, email, and suggestion has helped me improve the platform.&lt;/p&gt;




&lt;p&gt;*&lt;em&gt;What's Next&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
I'm currently working on:&lt;/p&gt;

&lt;p&gt;· Quest 2: Intermediate lessons for all three courses&lt;br&gt;
· More Snippets: New UI components every month&lt;br&gt;
· Project Showcase: A section where students can share their own projects&lt;/p&gt;

&lt;p&gt;My goal is to make makuistudio.com the most beginner‑friendly place to learn HTML, Python, and AI – completely free.&lt;/p&gt;




&lt;p&gt;Try It Yourself&lt;/p&gt;

&lt;p&gt;If you're learning to code or looking for free resources, I'd love for you to check it out:&lt;/p&gt;

&lt;p&gt;🔗 makuistudio.com&lt;/p&gt;

&lt;p&gt;All lessons, snippets, and guides are completely free – no sign‑up required.&lt;/p&gt;




&lt;p&gt;If you found this article helpful, consider sharing it with someone who's learning to code.&lt;/p&gt;

&lt;h1&gt;
  
  
  html #css #python #ai #webdev #beginners #freecourse
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>🤖 AI LESSON 1.1: What is Artificial Intelligence Really? 🧠🚀</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Fri, 04 Sep 2026 13:57:52 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/ai-lesson-11-what-is-artificial-intelligence-really-3oi8</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/ai-lesson-11-what-is-artificial-intelligence-really-3oi8</guid>
      <description>&lt;p&gt;🤖 AI LESSON 1.1: What is Artificial Intelligence Really? 🧠🚀&lt;/p&gt;

&lt;p&gt;We see the buzzword everywhere—from automated algorithms to generative systems. But as a software engineer or data analyst, how do you actually define Artificial Intelligence under the hood? It isn't magic; it's pure mathematics, classification parameters, and structural data optimization.&lt;/p&gt;

&lt;p&gt;Let's challenge our community logic before we compile our next script! 🔍&lt;/p&gt;

&lt;p&gt;👇 LOG YOUR ANSWER OR CLASSIFICATION IN THE COMMENTS SECTION:&lt;br&gt;
1️⃣ What is the core engineering difference between standard static automation code (like an If/Else script) and a true Machine Learning model?&lt;br&gt;
2️⃣ Why does modern Deep Learning rely so heavily on multi-layered Neural Networks rather than standard structural algorithms?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F746olwifts7k6fmrazko.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F746olwifts7k6fmrazko.jpg" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stop drowning in shallow tech buzzwords. Our open-access curriculum breaks down the mathematical foundations, token structures, and core neural layers cleanly without hidden walls or credit card traps.&lt;/p&gt;

&lt;p&gt;Grab your reference sheets and explore the launch module:&lt;br&gt;
👉 makuistudio.com&lt;/p&gt;

&lt;p&gt;Comment your answers below—let's unlock the mechanics of machine intelligence together! ⬇️&lt;/p&gt;

&lt;h1&gt;
  
  
  ArtificialIntelligence #DeepLearning #MachineLearning #100DaysOfCode #AIForBeginners #MakuiStudio
&lt;/h1&gt;

</description>
      <category>makuistudio</category>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>📦 PYTHON LESSON 1.3: Lists vs. Tuples — Mastering Sequences! 🐍🚀</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Wed, 02 Sep 2026 14:39:49 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/python-lesson-13-lists-vs-tuples-mastering-sequences-22oa</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/python-lesson-13-lists-vs-tuples-mastering-sequences-22oa</guid>
      <description>&lt;p&gt;📦 PYTHON LESSON 1.3: Lists vs. Tuples — Mastering Sequences! 🐍🚀&lt;/p&gt;

&lt;p&gt;When writing backend code or managing data arrays, you'll constantly need to store multiple items inside a single variable. In Python, your primary tools for this are Lists and Tuples. They look similar, but under the hood, they act completely differently.&lt;/p&gt;

&lt;p&gt;Let's test our collective engineering logic! Take a close look at the graphic below: 🔍&lt;/p&gt;

&lt;p&gt;👇 DROP YOUR CHOICE OR TECHNICAL GUESS IN THE COMMENTS:&lt;br&gt;
1️⃣ Look at these two variables: my_data = [10, 20] vs. user_data = (10, 20). If your script needs to dynamically append, pop, or change values during execution, which variable structure must you use?&lt;br&gt;
2️⃣ Why does Python process Tuples significantly faster in memory than standard Lists? &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnugyt53mmj1l1xzl8yg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnugyt53mmj1l1xzl8yg5.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stop relying on confusing, unorganized programming guides. Our 100% open-access 10-lesson Ultimate Python Guide breaks down data structures cleanly without hidden fees or signup walls.&lt;/p&gt;

&lt;p&gt;Grab your production code blocks and start your training module:&lt;br&gt;
👉 ://makuistudio.com&lt;/p&gt;

&lt;p&gt;Comment your answers below—let's keep leveling up our backend engineering! ⬇️&lt;/p&gt;

&lt;h1&gt;
  
  
  PythonProgramming #LearnPython #DataStructures #100DaysOfCode #BackendDeveloper #MakuiStudio
&lt;/h1&gt;

</description>
      <category>makuistudio</category>
      <category>python</category>
      <category>ai</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>📦 PYTHON LESSON 1.2: Mastering Variables &amp; Data Types! 🐍🚀</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Tue, 01 Sep 2026 17:54:40 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/python-lesson-12-mastering-variables-data-types-nja</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/python-lesson-12-mastering-variables-data-types-nja</guid>
      <description>&lt;p&gt;📦 PYTHON LESSON 1.2: Mastering Variables &amp;amp; Data Types! 🐍🚀&lt;/p&gt;

&lt;p&gt;Computers don't just process commands—they need a structured way to store data in memory. In Python, variables act like labeled storage boxes where you keep your values, whether it's text, numbers, or true/false state variables.&lt;/p&gt;

&lt;p&gt;Let's test our core logic parameters early! Take a look at the graphic below: 🔍&lt;/p&gt;

&lt;p&gt;👇 DROP YOUR CHOICE OR ANSWER IN THE COMMENTS SECTION:&lt;br&gt;
1️⃣ Look at this statement: user_rank = "1". Is this variable interpreted as an Integer (number) or a String (text data)? Why do those quotation marks change everything?&lt;br&gt;
2️⃣ Unlike other languages, why does Python NOT force you to declare a specific data keyword (like 'int' or 'string') before initializing a variable?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi4vamkn8a71j9iq3jyoi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi4vamkn8a71j9iq3jyoi.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stop following messy, scattered programming tutorials. Our completely free 10-lesson Ultimate Python Guide breaks down software development architecture without any signup paywalls or credit card traps.&lt;/p&gt;

&lt;p&gt;Grab your production code blocks and start your training module:&lt;br&gt;
👉 ://makuistudio.com&lt;/p&gt;

&lt;p&gt;Comment your answers below—let's master clean backend engineering together! ⬇️&lt;/p&gt;

&lt;h1&gt;
  
  
  PythonProgramming #LearnPython #CodingBasics #100DaysOfCode #BackendDeveloper #MakuiStudio
&lt;/h1&gt;

</description>
      <category>makuistudio</category>
      <category>python</category>
      <category>coding</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>🐍 PYTHON LESSON 1.1: Writing Your Very First Line of Code! 🚀</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Tue, 01 Sep 2026 17:28:13 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/python-lesson-11-writing-your-very-first-line-of-code-kf5</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/python-lesson-11-writing-your-very-first-line-of-code-kf5</guid>
      <description>&lt;p&gt;🐍 PYTHON LESSON 1.1: Writing Your Very First Line of Code! 🚀&lt;/p&gt;

&lt;p&gt;If you want to enter software development, build automation scripts, or dive into AI logic, Python is your ultimate starting point. Unlike other languages that require 5+ lines of boilerplate just to load, Python strips away the clutter.&lt;/p&gt;

&lt;p&gt;Let's look at the absolute foundation syntax in the graphic below! 🔍&lt;/p&gt;

&lt;p&gt;👇 DROP YOUR INTERACTIVE GUESS OR REASON IN THE COMMENTS:&lt;br&gt;
1️⃣ Why does Python use simple quotation marks inside the print() function instead of requiring complex structural brackets or structural layout tags?&lt;br&gt;
2️⃣ What happens to your code if you spell print with a capital "P" (Print)? &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnvqr49qgldsa3n98hi16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnvqr49qgldsa3n98hi16.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;br&gt;
Stop overcomplicating your entry into programming. In our 10-lesson Ultimate Python Guide, we skip the expensive bootcamp traps and teach you pure logic structures from the ground up completely free.&lt;/p&gt;

&lt;p&gt;Grab your boilerplate code scripts and test your first script live:&lt;br&gt;
👉 &lt;a href="https://makuistudio.com" rel="noopener noreferrer"&gt;makuistudio.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Comment your answers below—let's unlock backend logic together! ⬇|&lt;/p&gt;

&lt;h1&gt;
  
  
  PythonProgramming #LearnPython #100DaysOfCode #BackendDeveloper #CodingBeginners #MakuiStudio
&lt;/h1&gt;

</description>
      <category>makuistudio</category>
      <category>python</category>
      <category>coding</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Free Lesson Courses for HTML, Python, AI and more</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Mon, 31 Aug 2026 15:17:28 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/free-lesson-courses-for-html-python-ai-and-more-2ncd</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/free-lesson-courses-for-html-python-ai-and-more-2ncd</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0l99xxacu3y2xpq9qhab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0l99xxacu3y2xpq9qhab.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>makuistudio</category>
      <category>html</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Lesson 1.2 HTML Coding</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Mon, 31 Aug 2026 15:16:23 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/lesson-12-html-coding-2eg3</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/lesson-12-html-coding-2eg3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3t3eug8fnjohpudr4npk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3t3eug8fnjohpudr4npk.png" alt=" " width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>makuistudio</category>
      <category>html</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Lesson 1.1 HTML Coding</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Mon, 31 Aug 2026 15:15:20 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/lesson-11-html-coding-4kc0</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/lesson-11-html-coding-4kc0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl8rlhltqmwdunffonrsk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl8rlhltqmwdunffonrsk.png" alt=" " width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>makuistudio</category>
      <category>html</category>
      <category>webdev</category>
      <category>frontend</category>
    </item>
    <item>
      <title>A complete beginner friendly course hub</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Wed, 03 Jun 2026 16:10:56 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/a-complete-beginner-friendly-course-hub-4p8i</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/a-complete-beginner-friendly-course-hub-4p8i</guid>
      <description>&lt;p&gt;Free resource: A complete beginner friendly course hub for web development and Python&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mykhurram068-mak.github.io/ui-learning-platform/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>python</category>
      <category>html</category>
    </item>
    <item>
      <title>How to Add Dark Mode to Any Website in 5 Minutes (with localStorage)</title>
      <dc:creator>Khawaja Khurram (MAK)</dc:creator>
      <pubDate>Sat, 30 May 2026 08:39:01 +0000</pubDate>
      <link>https://dev.to/khawaja_khurrammak_6ad/how-to-add-dark-mode-to-any-website-in-5-minutes-with-localstorage-2618</link>
      <guid>https://dev.to/khawaja_khurrammak_6ad/how-to-add-dark-mode-to-any-website-in-5-minutes-with-localstorage-2618</guid>
      <description>&lt;p&gt;&lt;strong&gt;# How to Add Dark Mode to Any Website in 5 Minutes (with localStorage)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dark mode isn't just a trend anymore – it's an expected feature. Users want it for better readability and less eye strain.&lt;/p&gt;

&lt;p&gt;The good news? You can add it to &lt;strong&gt;any existing website&lt;/strong&gt; in about 5 minutes with pure CSS and a few lines of JavaScript.&lt;/p&gt;

&lt;p&gt;No frameworks. No dependencies. Just copy, paste, and customize.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Build
&lt;/h2&gt;

&lt;p&gt;A complete dark mode toggle that:&lt;/p&gt;

&lt;p&gt;✅ Saves user preference in localStorage (persists across visits)&lt;br&gt;
✅ Detects system theme automatically&lt;br&gt;
✅ Lets users override system preference&lt;br&gt;
✅ Works on any existing website&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr41ue9yob6e0rqex7il.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr41ue9yob6e0rqex7il.png" alt="Dark mode toggle demo" width="800" height="174"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: CSS Variables (The Foundation)
&lt;/h2&gt;

&lt;p&gt;CSS variables make theme switching effortless. Define your light theme as default, then override for dark mode.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Light theme (default) */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f8fafc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--bg-secondary&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;--text-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0f172a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--text-secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#475569&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e2e8f0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#3b82f6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Dark theme override */&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"dark"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0f172a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--bg-secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#1e293b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--text-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f1f5f9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--text-secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#94a3b8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#334155&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#60a5fa&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Apply variables to your elements */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&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;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&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;--text-primary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="m"&gt;0.3s&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;p&gt;The &lt;em&gt;transition&lt;/em&gt; property creates a smooth fade effect when switching themes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: The Toggle Switch HTML
&lt;/h2&gt;

&lt;p&gt;Add this toggle switch anywhere on your page. I put mine in the header.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
   &lt;br&gt;
   &lt;span&gt;&lt;/span&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And the CSS to make it look good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.theme-switch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;34px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.theme-switch&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.slider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ccc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.4s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;34px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.slider&lt;/span&gt;&lt;span class="nd"&gt;:before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;26px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;26px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.4s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="nd"&gt;:checked&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nc"&gt;.slider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&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;--accent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="nd"&gt;:checked&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nc"&gt;.slider&lt;/span&gt;&lt;span class="nd"&gt;:before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;26px&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;
  
  
  Step 3: The JavaScript (3 Simple Functions)
&lt;/h2&gt;

&lt;p&gt;Here's the code logic. It's only 20 lines.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Apply theme to the page&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&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;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data-theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Update toggle checkbox&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;toggle&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="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;darkModeToggle&lt;/span&gt;&lt;span class="dl"&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;toggle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;toggle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&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;// Detect system preference&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getSystemTheme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;(prefers-color-scheme: dark)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;matches&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&lt;/span&gt;&lt;span class="dl"&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;// Initialize on page load&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;savedTheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;savedTheme&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;getSystemTheme&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// Listen to toggle clicks&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;darkModeToggle&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;setTheme&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;light&lt;/span&gt;&lt;span class="dl"&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;
  
  
  Step 4: Put It All Together
&lt;/h2&gt;

&lt;p&gt;Here's complete working example you can copy into any HTML file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Dark Mode Demo&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;/* Light mode (default) */&lt;/span&gt;
    &lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="py"&gt;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f8fafc&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="py"&gt;--text-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0f172a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="py"&gt;--border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e2e8f0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;/* Dark mode */&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"dark"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="py"&gt;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#0f172a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="py"&gt;--text-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f1f5f9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="py"&gt;--border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#334155&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;background&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;--bg-primary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nl"&gt;color&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;--text-primary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="m"&gt;0.3s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;system-ui&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c"&gt;/* Toggle switch CSS here (from Step 2) */&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Dark Mode Demo&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Click the toggle below. Your preference is saved automatically.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"theme-switch"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"darkModeToggle"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"slider"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="c1"&gt;// JavaScript from Step 3 here&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How It Works (The 30-Second Explanantion)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS Variables store all your colors in one place.&lt;/li&gt;
&lt;li&gt;[data-theme="dark"] overrides those variables when active.&lt;/li&gt;
&lt;li&gt;localStorage remembers the user's choice between visits.&lt;/li&gt;
&lt;li&gt;matchMedia detects if their OS is already in dark mode.&lt;/li&gt;
&lt;li&gt;One event listener toggles everything when clicked.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Pro Tips&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Tip 1: Add more than colors&lt;/strong&gt;&lt;br&gt;
Dark mode can also adjust shadows, borders and even images.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;date-theme&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"dark"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;brightness&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0.8&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;p&gt;&lt;strong&gt;Tip 2: Listen for system changes&lt;/strong&gt;&lt;br&gt;
This updates the page if the user changes their OS theme while your site is open:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;(prefers-color-scheme: dark).addEventListener(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;, (e) =&amp;gt; {
!localStorage.getItem(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;)) {
tTheme(e.matches ? &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; : &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;light&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;);
}
});
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tip 3: Use semantic HTML&lt;/strong&gt;&lt;br&gt;
The data-theme attribute is semantic and accessible. Screen readers understand it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live Demo&lt;/strong&gt;&lt;br&gt;
See the complete working example here:&lt;br&gt;
👉 &lt;a href="https://mykhurram068-mak.github.io/ui-learning-platform/darkmode.html" rel="noopener noreferrer"&gt;Live Dark Mode Demo with 3 Implementations&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The live demo includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Toggle switch with smooth animation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Match System" button to reset to OS preference&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;localStorage persistence&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Want More UI Components?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'm building a free library of copy-paste UI snippets. Here's what's available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Responsive navbar with mobile hamburger menu&lt;/li&gt;
&lt;li&gt;4 CSS loaders (spinner, pulse dots, skeleton, progress bar)&lt;/li&gt;
&lt;li&gt;Login/ Signup forms with validation and password toggle&lt;/li&gt;
&lt;li&gt;Dark mode toggle (the one you just learned)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;All frees snippets&lt;/strong&gt; here: &lt;a href="https://mykhurram068-mak.github.io/ui-learning-platform" rel="noopener noreferrer"&gt;UI Studio&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Need Advanced Components?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I also offer a Pro Pack with 15 premium snippets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5 navbar variations (mega menu, sticky, transparent, etc.)&lt;/li&gt;
&lt;li&gt;5 advanced loaders (skeleton tables, infinite scroll, SVG)&lt;/li&gt;
&lt;li&gt;5 form components (multi-step, OTP input, file upload)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;[Get the Pro Pack - $7 one-time]&lt;/strong&gt; (&lt;a href="https://mykhurram068-mak.github.io/ui-learning-platform/pro-pack.html" rel="noopener noreferrer"&gt;https://mykhurram068-mak.github.io/ui-learning-platform/pro-pack.html&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step            What You Did                      Time&lt;/strong&gt;&lt;br&gt;
1               Added CSS variables               1 min&lt;br&gt;
2               Added dark mode overrides         1 min&lt;br&gt;
3               Added toggle HTML/CSS             2 min&lt;br&gt;
4               Added JavaScript                  1 min&lt;br&gt;
Total           Dark mode complete                5 minutes&lt;/p&gt;

&lt;p&gt;Dark mode is one of those features that users notice and appreciate. It shows attention to detail and improves accessibility.&lt;/p&gt;

&lt;p&gt;Now go add dark mode to your projects!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Found this helpful?&lt;/em&gt; Consider buying me a coffee to support more free tutorials.&lt;br&gt;
☕ &lt;a href="https://ko-fi.com/uilearningbymak" rel="noopener noreferrer"&gt;Buy me a Coffee&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want the full code + 3 implementation methods?&lt;br&gt;
🔗 Live Demo &amp;amp; Code (&lt;a href="https://mykhurram068-mak.github.io/ui-learning-platform" rel="noopener noreferrer"&gt;https://mykhurram068-mak.github.io/ui-learning-platform&lt;/a&gt;)&lt;/p&gt;

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