<?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: Asmaa Almadhoun</title>
    <description>The latest articles on DEV Community by Asmaa Almadhoun (@asmaa-almadhoun).</description>
    <link>https://dev.to/asmaa-almadhoun</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%2F3772372%2Fd7abf220-7429-43b4-aa21-447f6d221cd1.jpg</url>
      <title>DEV Community: Asmaa Almadhoun</title>
      <link>https://dev.to/asmaa-almadhoun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asmaa-almadhoun"/>
    <language>en</language>
    <item>
      <title>Astro: The Lightweight Challenger to Next.js for Landing Pages</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Thu, 29 Oct 2026 13:03:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/astro-the-lightweight-challenger-to-nextjs-for-landing-pages-5f4b</link>
      <guid>https://dev.to/asmaa-almadhoun/astro-the-lightweight-challenger-to-nextjs-for-landing-pages-5f4b</guid>
      <description>&lt;h2&gt;
  
  
  🤔 Imagine you're building a website with:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Same Header ✅&lt;/li&gt;
&lt;li&gt;Same Navigation ✅&lt;/li&gt;
&lt;li&gt;Same Footer ✅&lt;/li&gt;
&lt;li&gt;Different page content ✅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of copying the Header and Footer into every page, Astro lets you create a &lt;strong&gt;Layout&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of a Layout as a &lt;strong&gt;reusable page frame&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+------------------+
| Header / Navbar  |
+------------------+
|                  |
|  Page Content    |
|     (&amp;lt;slot /&amp;gt;)   |
|                  |
+------------------+
| Footer           |
+------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚙️ How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Layout
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
import Navbar from '../components/Navbar.astro';
import Footer from '../components/Footer.astro';

const { title } = Astro.props;
---

&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;Navbar title={title} /&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;{title}&amp;lt;/h1&amp;gt;

    &amp;lt;article&amp;gt;
      &amp;lt;slot /&amp;gt;
    &amp;lt;/article&amp;gt;

    &amp;lt;Footer /&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The magic is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;slot /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything placed between the layout tags will be injected into that slot.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 2: Use the Layout
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
import BaseLayout from '../layouts/BaseLayout.astro';
---

&amp;lt;BaseLayout title="Home Page"&amp;gt;
  &amp;lt;p&amp;gt;Hello from Home Page!&amp;lt;/p&amp;gt;
&amp;lt;/BaseLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Astro automatically inserts the content inside the Layout's:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;slot /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🎯 Why Use Layouts?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Without Layouts
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Page 1
 ├─ Header
 ├─ Footer

Page 2
 ├─ Header
 ├─ Footer

Page 3
 ├─ Header
 ├─ Footer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lots of duplicated code 😫&lt;/p&gt;

&lt;h3&gt;
  
  
  With Layouts
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BaseLayout
 ├─ Header
 ├─ Slot
 └─ Footer

Page 1 → Content A
Page 2 → Content B
Page 3 → Content C
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cleaner, reusable, and easier to maintain ✅&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Layouts with Markdown
&lt;/h2&gt;

&lt;p&gt;Astro can also apply Layouts to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.mdx&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;../layouts/BaseLayout.astro&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;My&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Article"&lt;/span&gt;
&lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Asmaa"&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your Markdown content is automatically injected into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;slot /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes blogs and documentation sites very easy to build.&lt;/p&gt;




&lt;h2&gt;
  
  
  📖 Accessing Frontmatter
&lt;/h2&gt;

&lt;p&gt;Markdown metadata (frontmatter) can be read inside the layout.&lt;/p&gt;

&lt;h3&gt;
  
  
  Markdown File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;layout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;../layouts/BaseLayout.astro&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;My&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;First&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Astro&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Article"&lt;/span&gt;
&lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Asmaa"&lt;/span&gt;
&lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;29&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Oct&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;2026"&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layout File
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
const { frontmatter } = Astro.props;
---

&amp;lt;h1&amp;gt;{frontmatter.title}&amp;lt;/h1&amp;gt;

&amp;lt;slot /&amp;gt;

&amp;lt;p&amp;gt;Written by {frontmatter.author}&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Date: {frontmatter.date}&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧩 MDX Layouts
&lt;/h2&gt;

&lt;p&gt;For MDX files, you can manually import a Layout and pass custom props.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
import BaseLayout from '../../layouts/BaseLayout.astro';

function fancyJsHelper() {
  return "Welcome to Astro!";
}
---

&amp;lt;BaseLayout
  title={frontmatter.title}
  fancyJsHelper={fancyJsHelper}
&amp;gt;
  My MDX Content
&amp;lt;/BaseLayout&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the Layout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
const { title, fancyJsHelper } = Astro.props;
---

&amp;lt;h1&amp;gt;{title}&amp;lt;/h1&amp;gt;

&amp;lt;slot /&amp;gt;

&amp;lt;p&amp;gt;{fancyJsHelper()}&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows MDX pages to use JavaScript and custom logic.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⭐ Key Takeaway
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Astro Layouts = Reusable Page Templates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reuse Header/Footer&lt;/li&gt;
&lt;li&gt;Keep a consistent design&lt;/li&gt;
&lt;li&gt;Reduce duplicated code&lt;/li&gt;
&lt;li&gt;Build blogs and documentation easily&lt;/li&gt;
&lt;li&gt;Inject page content using &lt;code&gt;&amp;lt;slot /&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Share common UI across the entire site&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Simple Analogy
&lt;/h3&gt;

&lt;p&gt;Think of a Layout as a &lt;strong&gt;house blueprint&lt;/strong&gt; 🏠&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Walls, doors, and roof = Layout&lt;/li&gt;
&lt;li&gt;Furniture inside each room = Page Content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You build the structure once and reuse it everywhere.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Tiny CSS Detail Stopped Countdown Button from Shaking</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 13 Oct 2026 13:01:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/tiny-css-detail-stopped-countdown-button-from-shaking-gke</link>
      <guid>https://dev.to/asmaa-almadhoun/tiny-css-detail-stopped-countdown-button-from-shaking-gke</guid>
      <description>&lt;p&gt;While working on a session countdown, I noticed a small but annoying UI issue: the button slightly changed its width every time the counter updated.&lt;/p&gt;

&lt;p&gt;With a senior developer’s eye, even the smallest movement becomes noticeable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does It Happen?
&lt;/h2&gt;

&lt;p&gt;In most fonts, digits do not have the same width. For example, &lt;code&gt;1&lt;/code&gt; is usually narrower than &lt;code&gt;8&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When the countdown changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Yes 4:50
Yes 4:49
Yes 4:48
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the text width changes too. If the button does not have a fixed width, it grows and shrinks by a few pixels, creating a distracting shaking effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Fix: &lt;code&gt;tabular-nums&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The CSS property &lt;code&gt;font-variant-numeric: tabular-nums&lt;/code&gt; gives every digit the same horizontal width.&lt;/p&gt;

&lt;p&gt;With Tailwind CSS, we can enable it using one class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"tabular-nums"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  Yes &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;formattedTime&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;4&lt;/code&gt;, &lt;code&gt;8&lt;/code&gt;, and every other digit occupy the same amount of space. The countdown can change without affecting the button’s width.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Not Use a Fixed Width?
&lt;/h2&gt;

&lt;p&gt;A fixed width may hide the issue, but it is not always flexible. It can break when the text changes, the interface is translated, or a different font size is used.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;tabular-nums&lt;/code&gt; solves the actual problem while keeping the component responsive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Is It Useful?
&lt;/h2&gt;

&lt;p&gt;Use &lt;code&gt;tabular-nums&lt;/code&gt; for any frequently changing numeric value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Countdown timers&lt;/li&gt;
&lt;li&gt;Digital clocks&lt;/li&gt;
&lt;li&gt;Prices and financial values&lt;/li&gt;
&lt;li&gt;Dashboard statistics&lt;/li&gt;
&lt;li&gt;Live scores&lt;/li&gt;
&lt;li&gt;Data tables&lt;/li&gt;
&lt;li&gt;Progress indicators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is a small CSS detail, but it makes the interface feel more stable and polished.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Notice the details. Read more. Code smart.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>ui</category>
    </item>
    <item>
      <title>The Day I Stopped Writing Hover Colors Manually</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 06 Oct 2026 13:10:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/the-day-i-stopped-writing-hover-colors-manually-566e</link>
      <guid>https://dev.to/asmaa-almadhoun/the-day-i-stopped-writing-hover-colors-manually-566e</guid>
      <description>&lt;p&gt;Every frontend project starts the same way.&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="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f59e0b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#d97706&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;At first, it looks harmless.&lt;/p&gt;

&lt;p&gt;Then the requirements grow.&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="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f59e0b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#d97706&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-active&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#b45309&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ea9a00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;245&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;158&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.2&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;Somehow, one color became five.&lt;/p&gt;

&lt;p&gt;And every time the design team changes the brand color, we repeat the same process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the color picker&lt;/li&gt;
&lt;li&gt;Make it darker for hover&lt;/li&gt;
&lt;li&gt;Make it even darker for active&lt;/li&gt;
&lt;li&gt;Adjust the shadow color&lt;/li&gt;
&lt;li&gt;Hope everything still looks consistent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I never questioned this workflow.&lt;/p&gt;

&lt;p&gt;Until I discovered &lt;strong&gt;OKLCH&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem We Pretend Doesn't Exist
&lt;/h2&gt;

&lt;p&gt;Imagine our primary color is:&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="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;#ffa000&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need a hover color.&lt;/p&gt;

&lt;p&gt;What do we do?&lt;/p&gt;

&lt;p&gt;Usually something like:&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="nt"&gt;--primary-hover&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;#f29000&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But how did we get that value?&lt;/p&gt;

&lt;p&gt;Most of the time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trial and error&lt;/li&gt;
&lt;li&gt;Design tool adjustments&lt;/li&gt;
&lt;li&gt;Visual guessing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no real system.&lt;/p&gt;

&lt;p&gt;We're manually creating color variations instead of describing how a color should change.&lt;/p&gt;




&lt;h2&gt;
  
  
  Then I Found This Weird Syntax
&lt;/h2&gt;

&lt;p&gt;One day I came across this:&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="nt"&gt;background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;oklch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;calc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;l&lt;/span&gt; &lt;span class="nt"&gt;-&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;05&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;c&lt;/span&gt;
  &lt;span class="nt"&gt;h&lt;/span&gt;
&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My first reaction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Wait...&lt;/p&gt;

&lt;p&gt;I can generate the hover color from the original color?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No extra color variable?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What OKLCH Changed for Me
&lt;/h2&gt;

&lt;p&gt;Instead of storing multiple versions of the same color:&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="nt"&gt;--primary&lt;/span&gt;
&lt;span class="nt"&gt;--primary-hover&lt;/span&gt;
&lt;span class="nt"&gt;--primary-active&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I only keep the source color:&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="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;oklch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;75&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;18&lt;/span&gt; &lt;span class="err"&gt;70&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then create variations on demand.&lt;/p&gt;

&lt;p&gt;Hover:&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="nt"&gt;background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;oklch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;calc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;l&lt;/span&gt; &lt;span class="nt"&gt;-&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;05&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;c&lt;/span&gt;
  &lt;span class="nt"&gt;h&lt;/span&gt;
&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Active:&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="nt"&gt;background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;oklch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;calc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;l&lt;/span&gt; &lt;span class="nt"&gt;-&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;c&lt;/span&gt;
  &lt;span class="nt"&gt;h&lt;/span&gt;
&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Focus:&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="nt"&gt;background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;oklch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
  &lt;span class="nt"&gt;from&lt;/span&gt; &lt;span class="nt"&gt;var&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;--primary&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;calc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="err"&gt;05&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;c&lt;/span&gt;
  &lt;span class="nt"&gt;h&lt;/span&gt;
&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The color stays the same.&lt;/p&gt;

&lt;p&gt;Only its lightness changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Moment It Clicked
&lt;/h2&gt;

&lt;p&gt;Traditional CSS asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What should the hover color be?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OKLCH asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How should the base color change?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That small shift in thinking makes a huge difference.&lt;/p&gt;

&lt;p&gt;Before:&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="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#22c55e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--success-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#16a34a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="py"&gt;--warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f59e0b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--warning-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#d97706&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="py"&gt;--error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ef4444&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--error-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#dc2626&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;After:&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="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(...);&lt;/span&gt;
  &lt;span class="py"&gt;--warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;(...);&lt;/span&gt;
  &lt;span class="py"&gt;--error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oklch&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;And every hover color is generated automatically:&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="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:hover&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;oklch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;from&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;--button-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="n"&gt;-&lt;/span&gt; &lt;span class="m"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;
    &lt;span class="n"&gt;h&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;No duplicate color tokens &amp;amp; No maintenance burden.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tailwind Is Already Doing This
&lt;/h2&gt;

&lt;p&gt;Many developers still think in HEX and RGB.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The industry isn't moving toward OKLCH because the syntax is cool.&lt;/p&gt;

&lt;p&gt;It's moving toward OKLCH because generating color variations mathematically is &lt;strong&gt;more reliable&lt;/strong&gt; than manually picking dozens of related colors.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The Hidden Benefit During Rebranding
&lt;/h2&gt;

&lt;p&gt;Imagine the design team changes the primary color.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
All need review.&lt;/p&gt;

&lt;p&gt;After:&lt;br&gt;
Change one value.&lt;/p&gt;

&lt;p&gt;Everything derived from it updates automatically.&lt;/p&gt;

&lt;p&gt;Hover, Active, Focus, Shadows, Borders, and Glows.&lt;/p&gt;

&lt;p&gt;All stay consistent.&lt;/p&gt;

</description>
      <category>css</category>
      <category>design</category>
      <category>frontend</category>
      <category>ui</category>
    </item>
    <item>
      <title>The Secret Behind Smarter AI Outputs: CLAUDE.md</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Wed, 30 Sep 2026 13:05:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/how-to-write-a-good-claudemd-file-5ao8</link>
      <guid>https://dev.to/asmaa-almadhoun/how-to-write-a-good-claudemd-file-5ao8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;AI performs less like a genius and more like a new teammate. The quality of its work depends on the clarity of its instructions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A practical guide to building maintainable AI instructions that improve code quality, reduce token usage, and scale across projects.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why CLAUDE.md Matters
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; is the first source of project context Claude reads when working in a repository.&lt;/p&gt;

&lt;p&gt;A well-written file helps Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand the project quickly&lt;/li&gt;
&lt;li&gt;Follow established architecture patterns&lt;/li&gt;
&lt;li&gt;Avoid repeating mistakes&lt;/li&gt;
&lt;li&gt;Produce more consistent outputs&lt;/li&gt;
&lt;li&gt;Use fewer tokens&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A poorly written file becomes a giant instruction dump that grows over time, increases token consumption, and makes it harder for Claude to identify what actually matters.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rule of thumb:&lt;/strong&gt; Keep always-on instructions small. Load detailed guidance only when needed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Recommended Structure
&lt;/h2&gt;

&lt;p&gt;After trying multiple approaches, I found the “Separate permanent project knowledge from topic-specific guidance” guide in Claude and organized it as it should be.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.claude/
├── CLAUDE.md
├── rules/
│   ├── FileArchitecture.md
│   ├── UI-Standards.md
│   ├── Forms.md
│   ├── Testing.md
│   ├── Api-Patterns.md
│   └── Shared-Components.md
└── skills/
    ├── create-feature/
    │   └── SKILL.md
    └── add-pagination/
        └── SKILL.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What Belongs in CLAUDE.md
&lt;/h2&gt;

&lt;p&gt;The root file should answer only three questions:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What is this repository?
&lt;/h3&gt;

&lt;p&gt;Provide a short summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;This repository contains a React application built using TypeScript and Vite.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. What must never be forgotten?
&lt;/h3&gt;

&lt;p&gt;Include only critical project invariants.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; React and shared dependencies must remain version-aligned.
&lt;span class="p"&gt;-&lt;/span&gt; Never bypass authorization checks.
&lt;span class="p"&gt;-&lt;/span&gt; Always use shared components before creating new ones.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Where are the detailed rules?
&lt;/h3&gt;

&lt;p&gt;Provide a lightweight rule index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Rules&lt;/span&gt;

| Rule File | Read When |
|------------|------------|
| rules/ui-standards.md | Editing UI components |
| rules/forms.md | Working on forms |
| rules/testing.md | Writing tests |
| rules/api-patterns.md | Editing services or API integrations |
| rules/architecture.md | Creating new features |
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Always-On vs On-Demand Context
&lt;/h2&gt;

&lt;p&gt;The biggest optimization is moving detailed guidance into rule files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Root CLAUDE.md
&lt;/h3&gt;

&lt;p&gt;Contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project overview&lt;/li&gt;
&lt;li&gt;Critical rules&lt;/li&gt;
&lt;li&gt;Rule index&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rule Files
&lt;/h3&gt;

&lt;p&gt;Contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Topic-specific guidance&lt;/li&gt;
&lt;li&gt;Code examples&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summery
&lt;/h2&gt;

&lt;p&gt;Finally, the best CLAUDE.md files don’t try to teach AI everything. They teach AI where to look.&lt;/p&gt;

&lt;p&gt;If you liked my effort, support this content by pressing Like. It motivates me to share more!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>codequality</category>
      <category>programming</category>
    </item>
    <item>
      <title>Do You Have Server-Side Data to Load in Your Select List and Not Local Data?</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 18 Aug 2026 13:06:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/do-you-have-server-side-data-to-load-in-your-select-list-and-not-local-data-3k5d</link>
      <guid>https://dev.to/asmaa-almadhoun/do-you-have-server-side-data-to-load-in-your-select-list-and-not-local-data-3k5d</guid>
      <description>&lt;p&gt;When building forms in React applications, selecting the right dropdown component can have a significant impact on performance, user experience, and maintainability.&lt;/p&gt;

&lt;p&gt;One common question developers face is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Should I use a regular Select component or an AsyncSelect component?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;The answer depends on where your data comes from.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Select for Local Data
&lt;/h2&gt;

&lt;p&gt;A standard Select component is the best choice when your options are already available in the application.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Statuses&lt;/li&gt;
&lt;li&gt;Roles&lt;/li&gt;
&lt;li&gt;Priorities&lt;/li&gt;
&lt;li&gt;Categories&lt;/li&gt;
&lt;li&gt;Fixed configuration values
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Select&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pending&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pending&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="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;approved&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Approved&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="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rejected&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Rejected&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="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this scenario:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The data is loaded with the page.&lt;/li&gt;
&lt;li&gt;Searching happens on the client side.&lt;/li&gt;
&lt;li&gt;No additional API requests are required.&lt;/li&gt;
&lt;li&gt;Implementation remains simple and straightforward.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since the list is small and static, loading all options at once is usually the most efficient approach.&lt;/p&gt;




&lt;h2&gt;
  
  
  Use AsyncSelect for Server-Side Data
&lt;/h2&gt;

&lt;p&gt;When your options must be retrieved from an API, AsyncSelect becomes the better solution.&lt;/p&gt;

&lt;p&gt;Consider examples such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Users&lt;/li&gt;
&lt;li&gt;Customers&lt;/li&gt;
&lt;li&gt;Organizations&lt;/li&gt;
&lt;li&gt;Products&lt;/li&gt;
&lt;li&gt;Samples&lt;/li&gt;
&lt;li&gt;Large reference tables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of loading thousands of records when the page opens, AsyncSelect fetches only the data that the user needs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;AsyncSelect&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-select/async&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;loadOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inputValue&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;`/api/users?search=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;inputValue&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AsyncSelect&lt;/span&gt; &lt;span class="na"&gt;loadOptions&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loadOptions&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a user types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The component sends a request such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /users?search=demo
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and displays only matching results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why AsyncSelect Is Better for Large Datasets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine a system containing 50,000 users.&lt;/p&gt;

&lt;p&gt;Loading all users into a regular Select component would:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increase page load time&lt;/li&gt;
&lt;li&gt;Consume unnecessary memory&lt;/li&gt;
&lt;li&gt;Slow down searching&lt;/li&gt;
&lt;li&gt;Create a poor user experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With AsyncSelect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data is loaded only when needed.&lt;/li&gt;
&lt;li&gt;Network requests are smaller.&lt;/li&gt;
&lt;li&gt;The page loads faster.&lt;/li&gt;
&lt;li&gt;Search is handled efficiently by the server.&lt;/li&gt;
&lt;li&gt;Scalability improves significantly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach is particularly important in enterprise applications where datasets continuously grow.&lt;/p&gt;

&lt;p&gt;Real-World Example&lt;br&gt;
❌ Using Select&lt;br&gt;
&lt;code&gt;&amp;lt;Select options={allUsers} /&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If allUsers contains thousands of records, the browser must download and render everything upfront.&lt;/p&gt;

&lt;p&gt;✅ Using AsyncSelect&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;AsyncSelect&lt;/span&gt;
&lt;span class="na"&gt;loadOptions&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;loadUsers&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="na"&gt;defaultOptions&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The component requests data only when the user searches, reducing both server and browser workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Recommendation
&lt;/h2&gt;

&lt;p&gt;A simple rule of thumb is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If your dropdown data is local and already available, use Select. If your dropdown data lives on the server and needs to be fetched dynamically, use AsyncSelect.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Choosing the correct component not only improves performance but also creates a faster and more scalable user experience, especially in large business applications such as LIMS, ERP, CRM, and other enterprise systems.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Designing with Context Modern CSS Trends</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 21 Jul 2026 13:05:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/designing-with-context-modern-css-trends-6na</link>
      <guid>https://dev.to/asmaa-almadhoun/designing-with-context-modern-css-trends-6na</guid>
      <description>&lt;p&gt;CSS has evolved dramatically in recent years. What used to require heavy JavaScript libraries or preprocessors is now achievable natively with modern CSS. In 2026, developers are embracing container queries, parent selectors, scroll-driven animations, and view transitions as the foundation of responsive and interactive design.&lt;/p&gt;

&lt;h2&gt;
  
  
  📐 &lt;strong&gt;Container Queries&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Traditionally, responsiveness relied on media queries tied to the viewport. But components often need to adapt to their parent container instead.&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;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;container-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-size&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@container&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;400px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.9rem&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;
  
  
  🧩 Parent Selector :has()
&lt;/h2&gt;

&lt;p&gt;The long-awaited :has() selector finally gives CSS the ability to style parents based on their children&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;.form-group&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="nd"&gt;:invalid&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="no"&gt;red&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="m"&gt;#ffe5e5&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;👉 No more JavaScript hacks to highlight invalid forms — CSS handles it natively.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎞️ Scroll-Driven Animations
&lt;/h2&gt;

&lt;p&gt;Animations tied to scroll position are now hardware-accelerated and declarative.&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="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;fadeIn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;from&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;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;50px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;to&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;1&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;translateY&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="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.section&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fadeIn&lt;/span&gt; &lt;span class="m"&gt;1s&lt;/span&gt; &lt;span class="n"&gt;linear&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;animation-timeline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;scroll&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="py"&gt;animation-range&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt; &lt;span class="n"&gt;cover&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Smooth parallax and reveal effects without JavaScript event listeners.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔄 View Transitions
&lt;/h2&gt;

&lt;p&gt;Page-to-page transitions are now possible even in multi-page apps.&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="nt"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;view-transition-name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::view-transition-old&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;page&lt;/span&gt;&lt;span class="o"&gt;)&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="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;::view-transition-new&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;page&lt;/span&gt;&lt;span class="o"&gt;)&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;1&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;opacity&lt;/span&gt; &lt;span class="m"&gt;0.5s&lt;/span&gt; &lt;span class="n"&gt;ease&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;👉 Native fade effects when navigating between pages — previously only achievable in SPAs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 Relative Color Syntax
&lt;/h2&gt;

&lt;p&gt;CSS now supports dynamic color mixing and perceptual color spaces like oklch.&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;.button&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;color-mix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="m"&gt;70%&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="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="nd"&gt;:hover&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;color-mix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;oklch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="m"&gt;50%&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="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Accessible, consistent color palettes without design tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧱 Masonry Layout
&lt;/h2&gt;

&lt;p&gt;Pinterest-style grids are now native:&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;.gallery&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;masonry&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&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;👉 Eliminates the need for complex JS libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 Old vs. New CSS Approaches
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Old Way&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;2026 Native CSS&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Responsive components&lt;/td&gt;
&lt;td&gt;Media queries&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Container queries&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parent-child styling&lt;/td&gt;
&lt;td&gt;JS class toggling&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;:has()&lt;/code&gt;** selector**&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parallax/reveal effects&lt;/td&gt;
&lt;td&gt;JS scroll listeners&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Scroll-driven animations&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Page transitions&lt;/td&gt;
&lt;td&gt;SPA frameworks&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;View transitions&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reusable styles&lt;/td&gt;
&lt;td&gt;Sass/Less mixins&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Native CSS mixins&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Masonry grids&lt;/td&gt;
&lt;td&gt;JS libraries&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;display:&lt;/code&gt;masonry``&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

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

&lt;p&gt;CSS in 2026 is lighter, faster, and more declarative than ever. By mastering container queries, :has(), scroll-driven animations, and view transitions, developers can build responsive, interactive, and accessible designs without relying on heavy JavaScript frameworks.&lt;/p&gt;

</description>
      <category>css</category>
      <category>programming</category>
      <category>frontend</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Lines vs Blocks(CSS): Divide &amp; Grid Explained</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 26 May 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/lines-vs-blockscss-divide-grid-explained-57hl</link>
      <guid>https://dev.to/asmaa-almadhoun/lines-vs-blockscss-divide-grid-explained-57hl</guid>
      <description>&lt;p&gt;Divider lines are one of the most underrated tools in modern UI design. At first glance, they may seem like nothing more than thin strokes on a screen. Yet, when used thoughtfully, they transform cluttered layouts into clean, organized interfaces. A simple line can elevate a feature list from ordinary to premium, guiding the user’s eye and making information easier to scan.&lt;/p&gt;

&lt;p&gt;For designers, dividers are a subtle way to add structure. For developers, however, implementing them in responsive grids often feels like a headache double borders, overlapping lines, and messy CSS hacks are common pitfalls. &lt;/p&gt;

&lt;p&gt;That’s where utility-first frameworks like Tailwind CSS step in, offering elegant solutions to a deceptively tricky problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem With Borders in Grids&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For developers, divider lines sound simple until responsive layouts enter the picture.&lt;/p&gt;

&lt;p&gt;A grid with borders can quickly become messy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Double-thick lines&lt;/li&gt;
&lt;li&gt;Overlapping borders&lt;/li&gt;
&lt;li&gt;Uneven spacing&lt;/li&gt;
&lt;li&gt;Broken corners&lt;/li&gt;
&lt;li&gt;Complex CSS selectors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What looks clean in a static mockup often becomes difficult in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Secret Life of Tailwind's divide&lt;/strong&gt;​&lt;/p&gt;

&lt;p&gt;To master the grid divider, you first have to understand how Tailwind’s divide-x and divide-y utilities actually work. They don't just blindly slap a border on every element. Instead, they leverage the CSS adjacent sibling selector (* + *).&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%2Fc53u4wpui0ru9zcyqwjl.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%2Fc53u4wpui0ru9zcyqwjl.png" alt="Vertical_List" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This layout uses grid-cols-1 and divide-y. Notice how the dark blue horizontal lines appear only between the grey rows, not at the very top or bottom of the container.&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%2Ftxejglqs8ku02g68tp0g.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%2Ftxejglqs8ku02g68tp0g.png" alt="Horizontal_Row" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This image displays three elements in a row using grid-cols-3 and divide-x. Thin, grey vertical lines divide the cards. Notice how the vertical dividers are perfectly flush with the blue background above and below the cards, separating the text elements while maintaining a sleek, unified container.&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%2F9m3839rra3ka017koofb.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%2F9m3839rra3ka017koofb.png" alt="Box_Grid" width="800" height="437"&gt;&lt;/a&gt;&lt;br&gt;
This image demonstrates how to handle a 2x2 grid (grid-cols-2). Standard divide utilities fail here. Instead, we use the "Background Gap Trick." The light grey container (the parent background) provides the divider colour. The four white cards are placed with a gap-px 1 pixel. creating perfect cross-hair intersection lines without any complex math. The icons are simple geometric shapes: a cube, a sphere, a pyramid, and a cylinder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Best Interfaces Use Both&lt;/strong&gt;&lt;br&gt;
The strongest UI systems combine lines and blocks intentionally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A dashboard may use cards as blocks&lt;/li&gt;
&lt;li&gt;But use divider lines inside each card&lt;/li&gt;
&lt;li&gt;A pricing section may use separate columns&lt;/li&gt;
&lt;li&gt;While subtle separators organize feature rows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This layered structure creates interfaces that feel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Organized, Premium, Easy to scan, Easy to maintain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trick is balance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Too many lines create clutter.&lt;/li&gt;
&lt;li&gt;Too many blocks create heaviness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great UI design sits between the two.&lt;/p&gt;

&lt;p&gt;A Simple Rule to Remember&lt;/p&gt;

&lt;p&gt;If users should feel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“These items belong together” → use lines&lt;/li&gt;
&lt;li&gt;“These items are separate sections” → use blocks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That single distinction solves most layout decisions.&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>css</category>
      <category>frontend</category>
      <category>ai</category>
    </item>
    <item>
      <title>Don't Make Me Think, Role of Colour in UX</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 05 May 2026 13:00:37 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/dont-make-me-think-role-of-colour-in-ux-5c0k</link>
      <guid>https://dev.to/asmaa-almadhoun/dont-make-me-think-role-of-colour-in-ux-5c0k</guid>
      <description>&lt;p&gt;In &lt;strong&gt;Don't Make Me Think&lt;/strong&gt;, Steve Krug introduces the concept of self-explanatory design. The idea is simple: when users land on a page, they should immediately understand what it is and how to use it; without effort or confusion. There should be no need for what Krug calls “cognitive ditch-digging.”&lt;/p&gt;

&lt;p&gt;When applying this principle to visual design, especially color, the goal shifts away from decoration and toward clarity. Color is not used just to make a page look appealing; it is used to remove ambiguity and guide users naturally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Reservoir of Goodwill&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of Krug’s key ideas is the “reservoir of goodwill.” This represents the patience users have when interacting with a product. Every time they encounter something confusing—such as a button that doesn’t look clickable or a color that carries no clear meaning—that reservoir begins to drain.&lt;/p&gt;

&lt;p&gt;To preserve this goodwill, visual design must support usability:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Visual hierarchy:&lt;/strong&gt; Color should clearly indicate what is important. If everything is bright or competing for attention, nothing stands out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency:&lt;/strong&gt; Actions should always look the same. For example, if a “Submit” button is blue on one page, it should remain blue across the entire application. Changing colors for the same action forces users to stop and think.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The 60–30–10 Rule in UX Design&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Although Krug does not specify an exact number of colors to use, modern UX practices—aligned with his philosophy—recommend keeping the color palette limited to maintain clarity.&lt;/p&gt;

&lt;p&gt;A common approach is the 60–30–10 rule, which organizes colors as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;60%: Primary or background color (usually neutral)&lt;/li&gt;
&lt;li&gt;30%: Secondary color for structure and layout&lt;/li&gt;
&lt;li&gt;10%: Accent color for key actions and highlights&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This structure helps create a balanced interface where users can easily identify priorities and actions without confusion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Krug’s philosophy emphasizes that good design should feel obvious. In terms of color, this means using it deliberately to communicate meaning, reinforce consistency, and guide user attention. A restrained and purposeful color system reduces cognitive load and helps users interact with interfaces effortlessly.&lt;/p&gt;

</description>
      <category>design</category>
      <category>ui</category>
      <category>ux</category>
    </item>
    <item>
      <title>Next.js Explained Using TikTok: SSR, SSG, ISR, and CSR Made Simple</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 21 Apr 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/nextjs-explained-using-tiktok-ssr-ssg-isr-and-csr-made-simple-2ec1</link>
      <guid>https://dev.to/asmaa-almadhoun/nextjs-explained-using-tiktok-ssr-ssg-isr-and-csr-made-simple-2ec1</guid>
      <description>&lt;p&gt;TikTok looks simple on the surface: open the app, watch videos, scroll endlessly.&lt;br&gt;
But behind that smooth experience is a complex system of rendering strategies, performance optimizations, and real-time interactions; exactly the kinds of problems that Next.js was designed to solve.&lt;/p&gt;

&lt;p&gt;If TikTok were built using Next.js, it wouldn’t rely on a single rendering method. Instead, it would combine &lt;strong&gt;SSR, SSG, ISR, CSR,&lt;/strong&gt; Streaming, Edge rendering, and partial rendering; each used deliberately to give users a fast, personalized experience at massive scale.&lt;br&gt;
Let’s tell TikTok’s story, one Next.js concept at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 1: Entering TikTok, Static First Impressions (SSG)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When someone visits TikTok for the first time, before logging in; they often see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Marketing pages&lt;/li&gt;
&lt;li&gt;Help center articles&lt;/li&gt;
&lt;li&gt;About TikTok content&lt;/li&gt;
&lt;li&gt;Community guidelines&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These pages rarely change and are the same for everyone.&lt;br&gt;
In Next.js terms, this is &lt;strong&gt;Static Site Generation (SSG)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Why SSG fits here&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content is predictable&lt;/li&gt;
&lt;li&gt;SEO matters&lt;/li&gt;
&lt;li&gt;Speed is critical&lt;/li&gt;
&lt;li&gt;Millions of users access these pages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSG allows TikTok to pre-build these pages once and serve them instantly from a CDN.&lt;/p&gt;

&lt;p&gt;In the TikTok story, SSG represents the front door, reliable, and welcoming to everyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 2: The “For You” Feed, Personalization at Scale (SSR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you log in, TikTok completely changes its behaviour.&lt;/p&gt;

&lt;p&gt;Now you see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A unique feed&lt;/li&gt;
&lt;li&gt;Tailored recommendations&lt;/li&gt;
&lt;li&gt;Content based on your interests, location, time, and device&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No two users see the same thing.&lt;br&gt;
This is Server-Side Rendering (SSR).&lt;/p&gt;

&lt;p&gt;Why SSR is necessary&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content must be personalized&lt;/li&gt;
&lt;li&gt;Data must be fresh&lt;/li&gt;
&lt;li&gt;SEO may still matter (for web versions)&lt;/li&gt;
&lt;li&gt;Security and authentication are required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With &lt;strong&gt;SSR&lt;/strong&gt;, every request can generate a fully customized page before it reaches the browser.&lt;/p&gt;

&lt;p&gt;In the story of TikTok, SSR is the brain, thinking in real time about you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 3: Trending Hashtags, Fast but Frequently Changing (ISR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TikTok’s Trending section is neither fully static nor fully dynamic.&lt;/p&gt;

&lt;p&gt;Trending hashtags and sounds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change every few minutes&lt;/li&gt;
&lt;li&gt;Are viewed by millions&lt;/li&gt;
&lt;li&gt;Don’t require second‑by‑second precision&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where Incremental Static Regeneration &lt;strong&gt;(ISR)&lt;/strong&gt; shines.&lt;br&gt;
Why ISR fits perfectly&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static performance&lt;/li&gt;
&lt;li&gt;Automatic background updates&lt;/li&gt;
&lt;li&gt;No rebuild of the entire app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pages can update every 30–60 seconds without losing speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ISR&lt;/strong&gt; is TikTok’s pulse, constantly updating, but never slowing down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 4: Interactions; Likes, Comments, Follows (CSR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Like a video&lt;/li&gt;
&lt;li&gt;Post a comment&lt;/li&gt;
&lt;li&gt;Follow a creator&lt;/li&gt;
&lt;li&gt;Save a video&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You expect instant feedback, not a page reload.&lt;br&gt;
This behavior is powered by Client-Side Rendering** (CSR)**.&lt;br&gt;
Why CSR is essential&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High interactivity&lt;/li&gt;
&lt;li&gt;Real-time UI updates&lt;/li&gt;
&lt;li&gt;Minimal delay&lt;/li&gt;
&lt;li&gt;No SEO concern for these actions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CSR handles all the living, breathing parts of TikTok that respond instantly to your touch.&lt;/p&gt;

&lt;p&gt;CSR is TikTok’s reflex system, immediate and interactive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 5: Videos First, Everything Else Later (Streaming SSR)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On TikTok, video content loads first.&lt;br&gt;
Comments, captions, and recommendations follow.&lt;br&gt;
This is intentional.&lt;br&gt;
With Streaming SSR and React Suspense, TikTok can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Render critical content immediately&lt;/li&gt;
&lt;li&gt;Stream less important UI parts later&lt;/li&gt;
&lt;li&gt;Improve perceived performance dramatically&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The user doesn’t wait for everything, only what matters most.&lt;/p&gt;

&lt;p&gt;Streaming is TikTok’s storytelling technique: hook the viewer first, fill in details later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 6: Profile Pages, Static Meets Dynamic (Partial Rendering)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A creator’s profile has:&lt;br&gt;
Static data: username, bio, profile photo&lt;br&gt;
Dynamic data: follower count, latest videos, follow status&lt;/p&gt;

&lt;p&gt;Using one rendering method for all of it would be inefficient.&lt;br&gt;
Next.js solves this with partial rendering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static parts&lt;/strong&gt; cached&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic parts&lt;/strong&gt; rendered on demand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach balances scalability, freshness, and cost.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Partial rendering is TikTok’s balance: efficiency without sacrificing accuracy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;The Big Picture: Why This Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TikTok’s success isn’t just about videos or algorithms.&lt;br&gt;
It’s about choosing the right rendering strategy for the right moment.&lt;br&gt;
Next.js makes this possible by allowing all these techniques to coexist in a single application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static where possible&lt;/li&gt;
&lt;li&gt;Dynamic where necessary&lt;/li&gt;
&lt;li&gt;Streaming where smart&lt;/li&gt;
&lt;li&gt;Client-side where interactive&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>nextjs</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AI Writes What You Ask. Architecture Survives What You Didn’t Expect</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Sat, 11 Apr 2026 08:35:33 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/ai-writes-what-you-ask-architecture-survives-what-you-didnt-expect-c9b</link>
      <guid>https://dev.to/asmaa-almadhoun/ai-writes-what-you-ask-architecture-survives-what-you-didnt-expect-c9b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why Human Judgment Still Matters in the Age of AI‑Assisted Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI‑assisted coding tools have transformed modern software development. They can generate boilerplate, suggest patterns, and accelerate delivery. &lt;/p&gt;

&lt;p&gt;Yet, as powerful as these tools are, they often fail in one critical dimension: design judgment. Being “smarter than AI” as a developer does not mean writing more complex code, it means designing systems that are resilient to ambiguity, change, and imperfect inputs.&lt;/p&gt;

&lt;p&gt;One of the most common and painful examples of this gap appears in how systems handle unexpected variations, such as null, undefined, empty values, or missing parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Illusion of Correctness in AI‑Generated Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI tools typically optimize for expected behavior. They assume ideal inputs, clear contracts, and happy paths. This makes their output appear correct; until reality intervenes.&lt;/p&gt;

&lt;p&gt;Consider your example:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If I do not send exactly null, the system crashes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From a machine’s perspective, this may be “technically correct” code. From a human architect’s perspective, it is a design failure.&lt;/p&gt;

&lt;p&gt;A well‑designed system should not collapse because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;null was replaced with undefined&lt;/li&gt;
&lt;li&gt;a field was omitted&lt;/li&gt;
&lt;li&gt;an empty string was passed&lt;/li&gt;
&lt;li&gt;a client behaved slightly differently than expected&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI‑assisted implementations often miss these nuances because they replicate patterns rather than challenge assumptions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clean Architecture: Designing for Reality, Not Perfection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Robert C. Martin’s Clean Architecture: A Craftsman’s Guide to Software Structure and Design emphasizes an essential truth:&lt;/p&gt;

&lt;p&gt;Software must be designed to survive change.&lt;/p&gt;

&lt;p&gt;Clean Architecture teaches that systems should be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Independent of frameworks&lt;/li&gt;
&lt;li&gt;Independent of UI&lt;/li&gt;
&lt;li&gt;Independent of databases&lt;/li&gt;
&lt;li&gt;Independent of external agencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly for your case, they should be independent of volatile input behaviour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Matters for Input Validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Clean Architecture, use cases define the rules of the application. That means they are responsible for deciding what is valid, acceptable, or recoverable, not controllers, not frameworks, and certainly not AI‑generated glue code.&lt;/p&gt;

&lt;p&gt;If your system crashes because a parameter is missing or slightly different, that logic is living in the wrong place, or not living anywhere at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Core Problem: Treating Inputs as Objects, Not Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI tends to treat input values literally:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;null ≠ undefined ≠ empty ≠ missing&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Humans, however, think conceptually:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“This value means ‘no data provided.’”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clean Architecture encourages us to elevate that intent into the core of the system. Instead of spreading defensive checks everywhere, we define semantic boundaries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does “absence” mean?&lt;/li&gt;
&lt;li&gt;Is this field required, optional, or conditional?&lt;/li&gt;
&lt;li&gt;What is the default behavior if it’s missing?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If those questions are not answered explicitly, AI has no chance of answering them correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Being Smarter Than AI: Design Principles That Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Normalize at the Boundaries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI often mirrors whatever structure it sees. A human architect knows better.&lt;br&gt;
At system boundaries (APIs, controllers, adapters), normalize inputs into a single internal representation. By the time data reaches your business rules, there should be one concept of “no value,” not five.&lt;/p&gt;

&lt;p&gt;This aligns directly with Clean Architecture’s rule of keeping frameworks and details at the edges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Move Validation into Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI‑generated code frequently validates inputs close to the framework layer. This is convenient and wrong.&lt;br&gt;
Clean Architecture insists that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Business rules own validation&lt;/li&gt;
&lt;li&gt;Use cases decide what is acceptable&lt;/li&gt;
&lt;li&gt;Frameworks merely pass data along&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When validation lives in use cases, handling null, missing, or empty values becomes a business decision, not a technical accident.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Define Explicit Contracts, Not Implicit Expectations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI excels at following patterns, but struggles with unstated intent.&lt;br&gt;
Clean Architecture favors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explicit input models&lt;/li&gt;
&lt;li&gt;Clear invariants&lt;/li&gt;
&lt;li&gt;Defined failure modes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your system crashes when a value is not exactly null, it means the contract was never truly defined, only assumed.&lt;br&gt;
Humans write contracts. AI follows them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Design for Change, Not Compliance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI optimizes for compliance with existing code. Humans optimize for change.&lt;br&gt;
Your API may work today because clients send perfect inputs. Tomorrow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a mobile app changes&lt;/li&gt;
&lt;li&gt;a third‑party integration behaves differently&lt;/li&gt;
&lt;li&gt;a serialization library updates its defaults&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clean Architecture prepares systems for that variability by isolating change and enforcing rules at the core.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; Intelligence Is in the Architecture, being smarter than AI is not about rejecting AI tools, it’s about using them responsibly.&lt;br&gt;
Let AI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;write repetitive code&lt;/li&gt;
&lt;li&gt;scaffold structures&lt;/li&gt;
&lt;li&gt;speed up implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let humans:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;efine boundaries&lt;/li&gt;
&lt;li&gt;clarify intent&lt;/li&gt;
&lt;li&gt;design for ambiguity&lt;/li&gt;
&lt;li&gt;enforce architectural discipline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clean Architecture provides the mental model that AI lacks: a focus on meaning, responsibility, and change. When your system gracefully handles null, undefined, empty, and missing values, not because of defensive hacks, but because of intentional design you are operating at a level AI has not yet reached.&lt;br&gt;
And that is what real software craftsmanship looks like.&lt;/p&gt;

&lt;p&gt;Reference&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Robert C. Martin, Clean Architecture: A Craftsman’s Guide to Software Structure and Design, 2017.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>architecture</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Why fetch() Can Be Safer Than Axios After the 2026 Axios Hack</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Wed, 01 Apr 2026 09:16:10 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/why-fetch-can-be-safer-than-axios-after-the-2026-axios-hack-6n5</link>
      <guid>https://dev.to/asmaa-almadhoun/why-fetch-can-be-safer-than-axios-after-the-2026-axios-hack-6n5</guid>
      <description>&lt;p&gt;The question isn’t whether Axios is a “bad” library; it’s about risk surface. The Axios NPM compromise in March 2026 exposed a structural weakness in depending on third‑party libraries for something browsers already provide natively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Axios was compromised; fetch() cannot be published with malware&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On March 31, 2026, attackers hijacked the npm account of Axios’s maintainer and published malicious versions (1.14.1 and 0.30.4) containing an obfuscated malware dropper. The malware executed automatically during installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In contrast:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fetch() is &lt;strong&gt;built into browsers and Node.js.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It &lt;strong&gt;cannot&lt;/strong&gt; be replaced or hijacked via a package manager.&lt;/li&gt;
&lt;li&gt;There is &lt;strong&gt;no installation step&lt;/strong&gt;, so no opportunity to insert post‑install malware.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thus, fetch() has &lt;strong&gt;zero supply‑chain risk&lt;/strong&gt; compared to a package like Axios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Axios’ supply-chain attack vector came from its dependency distribution model&lt;/strong&gt;&lt;br&gt;
The Axios compromise happened because:&lt;/p&gt;

&lt;p&gt;Attackers accessed the maintainer’s &lt;strong&gt;npm account&lt;/strong&gt;,&lt;br&gt;
Published malicious releases with a hidden dependency (plain-crypto-js),&lt;br&gt;
Inserted a &lt;strong&gt;postinstall script&lt;/strong&gt; that deployed a cross‑platform RAT.&lt;/p&gt;

&lt;p&gt;fetch() has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No dependencies&lt;/li&gt;
&lt;li&gt;No maintainer accounts to hijack&lt;/li&gt;
&lt;li&gt;No GitHub or npm supply chain to poison&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore, using &lt;strong&gt;fetch()&lt;/strong&gt; eliminates an entire attack surface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Axios introduced malware even though the code looked unchanged&lt;/strong&gt;&lt;br&gt;
Security investigators confirmed the attacker did not modify the Axios code directly, but only added a malicious dependency that executed during installation.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Even if you audited the Axios GitHub repo, you would not see the malicious code.&lt;/li&gt;
&lt;li&gt;This type of attack is impossible with fetch() because it isn’t installed from npm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Native fetch() is now fully supported and feature‑rich, reducing the need for Axios&lt;/strong&gt;&lt;br&gt;
Historically, Axios offered conveniences like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automatic JSON transformation&lt;/li&gt;
&lt;li&gt;request cancellation&lt;/li&gt;
&lt;li&gt;simpler syntax&lt;/li&gt;
&lt;li&gt;better error handling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern browsers and Node.js now support &lt;strong&gt;fetch()&lt;/strong&gt; with AbortController, streaming, improved error handling, and Response.json().&lt;/li&gt;
&lt;li&gt;The gap between Axios and native APIs has &lt;strong&gt;narrowed&lt;/strong&gt; significantly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given this parity, adding Axios creates unnecessary dependency risk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✔️ Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fetch is “better” than Axios from &lt;strong&gt;a security standpoint&lt;/strong&gt; because it is native, dependency‑free, cannot be hijacked through npm, and avoids the entire supply‑chain attack vector that enabled hackers to insert a remote‑access trojan into Axios’ malicious releases in March 2026&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%2F70m6mxhglrjbs6cbf7x8.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%2F70m6mxhglrjbs6cbf7x8.png" alt="Summary" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>javascript</category>
      <category>axios</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Code Meets Creativity: Using Google Stitch as a Frontend Developer</title>
      <dc:creator>Asmaa Almadhoun</dc:creator>
      <pubDate>Tue, 24 Mar 2026 07:11:19 +0000</pubDate>
      <link>https://dev.to/asmaa-almadhoun/code-meets-creativity-using-google-stitch-as-a-frontend-developer-1997</link>
      <guid>https://dev.to/asmaa-almadhoun/code-meets-creativity-using-google-stitch-as-a-frontend-developer-1997</guid>
      <description>&lt;p&gt;As frontend developers, we’re constantly exploring tools that help us move faster, from ideation to prototypes to production‑ready UI. Google Stitch has recently had a major revamp, positioning itself as an AI‑native design assistant that promises to help us explore layouts, generate UI structures, and test ideas without jumping into code immediately.&lt;br&gt;
While Stitch isn’t a full replacement for real design tools or real designers, it can play a meaningful role in a modern frontend workflow. Here’s how you can practically use it as a developer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Creating a Landing Page With Google Stitch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Move from idea → layout → code in minutes. Below is a simple, practical workflow showing how you can generate a landing page using Stitch, refine it, and turn it into usable frontend code.&lt;br&gt;
Each step includes a soft, rounded hybrid-style diagram to visually guide the user.&lt;/p&gt;

&lt;p&gt;1️⃣ Step 1, Open Google Stitch&lt;br&gt;
To begin, you visit Stitch and select your mode (Web or App).&lt;br&gt;
This is where you pick the model and start your design session.&lt;/p&gt;

&lt;p&gt;2️⃣ Step 2, Enter Your First Prompt&lt;br&gt;
Stitch works best with clear natural‑language instructions. You describe the structure and feel of the landing page, and Stitch generates the UI.&lt;br&gt;
Example prompt:&lt;/p&gt;

&lt;p&gt;“Create a modern landing page with a hero section, feature grid, testimonials, and a CTA. Keep it clean and easy to rebuild using React + Tailwind.”&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%2F5acut3ejy4bqqxlnxbye.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%2F5acut3ejy4bqqxlnxbye.png" alt="Stitch UI prompt" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3️⃣ Step 3, Stitch Generates the Layout&lt;br&gt;
Stitch analyzes your prompt and files, then produces the first version of your layout.&lt;br&gt;
It typically includes full sections like the following&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%2Fejjfq1w19jm2lhtqic4u.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%2Fejjfq1w19jm2lhtqic4u.png" alt="Stitch Layout landing page main section" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;4️⃣ Step 4, Refine Using Follow‑Up Prompts&lt;br&gt;
Just like a conversation, you can refine the design by telling Stitch what to change.&lt;br&gt;
This is ideal for adjusting spacing, layout balance, color contrast, and visual hierarchy.&lt;br&gt;
Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Increase spacing in the hero section.”&lt;/li&gt;
&lt;li&gt;“Make the color palette darker.”&lt;/li&gt;
&lt;li&gt;“Increase CTA visibility.”&lt;/li&gt;
&lt;/ul&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%2Fzcjug4pcrp3y2f2fy3qz.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%2Fzcjug4pcrp3y2f2fy3qz.png" alt="Zip file of Exporting" width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5️⃣ Step 5, Export the Code&lt;/p&gt;

&lt;p&gt;One of Stitch’s strengths is its code export ability.&lt;br&gt;
After generating your design, you can extract HTML/CSS or even React‑friendly markup to speed up your build, you will find &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Landing page (html)&lt;/li&gt;
&lt;li&gt;Design file contains rules &lt;/li&gt;
&lt;li&gt;Screen file is full Image of your landing page design&lt;/li&gt;
&lt;/ul&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%2F5y19o3akrejor7yq8vk1.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%2F5y19o3akrejor7yq8vk1.png" alt="screen shots of exporting stitch file .zip" width="684" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6️⃣ Step 6, Paste Into Your Code Editor&lt;br&gt;
Paste the exported code into your editor (VS Code, WebStorm, etc.).&lt;br&gt;
From here, you refine the structure, add Tailwind or your design tokens, and integrate real content.&lt;/p&gt;

&lt;p&gt;🎉 Final Thoughts&lt;br&gt;
Using Google Stitch as a frontend developer dramatically accelerates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UI ideation&lt;/li&gt;
&lt;li&gt;Layout prototyping&lt;/li&gt;
&lt;li&gt;Early‑stage design exploration&lt;/li&gt;
&lt;li&gt;Hand‑off between design &amp;amp; code&lt;/li&gt;
&lt;li&gt;Building real landing page code faster&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stitch doesn’t replace designers or developers, but it makes frontend workflows smoother and faster, especially when you need structure before styling.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>cra</category>
      <category>ai</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
