<?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: i am message</title>
    <description>The latest articles on DEV Community by i am message (@message).</description>
    <link>https://dev.to/message</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F258056%2F044340c8-3da6-464f-81e8-4c0e3d53be65.jpg</url>
      <title>DEV Community: i am message</title>
      <link>https://dev.to/message</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/message"/>
    <language>en</language>
    <item>
      <title>Pixels, Tokens, and Grids: Speaking the Same Language in Design and Code</title>
      <dc:creator>i am message</dc:creator>
      <pubDate>Tue, 02 Sep 2025 17:44:51 +0000</pubDate>
      <link>https://dev.to/message/pixels-tokens-and-grids-speaking-the-same-language-in-design-and-code-fc7</link>
      <guid>https://dev.to/message/pixels-tokens-and-grids-speaking-the-same-language-in-design-and-code-fc7</guid>
      <description>&lt;p&gt;Design and development handoff is one of the most critical points in a product’s lifecycle. A design may look clean and polished in Figma, Sketch, or Adobe XD, but if the specifications handed off to developers are inconsistent—such as using fractional pixel values (&lt;code&gt;13.7px&lt;/code&gt;, &lt;code&gt;22.4px&lt;/code&gt;, &lt;code&gt;47.2px&lt;/code&gt;) or icon sizes with decimals—it introduces friction, implementation errors, and long-term scalability problems.&lt;/p&gt;

&lt;p&gt;This article explains &lt;strong&gt;why consistency in values matters&lt;/strong&gt;, the &lt;strong&gt;technical issues caused by decimals and arbitrary sizing&lt;/strong&gt;, and how they impact &lt;strong&gt;accessibility, developer experience, and the scalability of a design system&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Role of Design Tokens
&lt;/h2&gt;

&lt;p&gt;Modern front-end development relies heavily on &lt;strong&gt;design tokens&lt;/strong&gt;. Tokens are named values representing design decisions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spacing:&lt;/strong&gt; &lt;code&gt;4px, 8px, 16px, 32px&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Typography:&lt;/strong&gt; &lt;code&gt;12px, 14px, 16px, 20px, 24px&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Colors:&lt;/strong&gt; &lt;code&gt;primary-500&lt;/code&gt;, &lt;code&gt;neutral-200&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Icons &amp;amp; Radius:&lt;/strong&gt; multiples of 4 or 8&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tokens create a shared language between design and code. They ensure &lt;strong&gt;consistency&lt;/strong&gt;, make global updates simple (e.g., updating brand colors or scaling typography), and eliminate arbitrary one-off values.&lt;/p&gt;

&lt;p&gt;👉 When a designer specifies &lt;code&gt;23.7px&lt;/code&gt; padding or a &lt;code&gt;13.5px&lt;/code&gt; font size, it breaks this system. Developers cannot map those values to tokens and must either round them (losing fidelity) or create exceptions (increasing inconsistency).&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Decimal Pixels Don’t Work
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Rendering Inconsistency Across Devices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Web and native platforms rely on &lt;strong&gt;device-independent pixels&lt;/strong&gt; (&lt;code&gt;dp&lt;/code&gt; in Android, &lt;code&gt;pt&lt;/code&gt; in iOS).&lt;/li&gt;
&lt;li&gt;A fractional value like &lt;code&gt;13.5px&lt;/code&gt; doesn’t translate well into these units; it gets rounded differently depending on device pixel ratio (DPR).&lt;/li&gt;
&lt;li&gt;Result: Slight misalignments, blurred icons, and inconsistent spacing across devices.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Icon Sharpness and Pixel Grid
&lt;/h3&gt;

&lt;p&gt;Icons need to align perfectly to the &lt;strong&gt;pixel grid&lt;/strong&gt; to render sharply.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;23.7px&lt;/code&gt; icon will be anti-aliased (blurred edges).&lt;/li&gt;
&lt;li&gt;Exporting icons at consistent whole sizes (16, 20, 24, 32px) ensures sharpness on all screens.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Scalability and Maintainability
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Arbitrary decimals lead to &lt;strong&gt;CSS bloat&lt;/strong&gt;: &lt;code&gt;23.7px&lt;/code&gt;, &lt;code&gt;47.2px&lt;/code&gt;, &lt;code&gt;11.3px&lt;/code&gt; all become unique rules.&lt;/li&gt;
&lt;li&gt;This breaks the principle of &lt;strong&gt;reusable tokens&lt;/strong&gt; → every new screen introduces exceptions.&lt;/li&gt;
&lt;li&gt;When scaling designs (responsive layouts, theming, accessibility), inconsistencies multiply.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Cross-Platform Alignment
&lt;/h3&gt;

&lt;p&gt;A design system must work across &lt;strong&gt;Web, iOS, and Android&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On iOS, &lt;code&gt;pt&lt;/code&gt; values are integers.&lt;/li&gt;
&lt;li&gt;On Android, &lt;code&gt;dp/sp&lt;/code&gt; values are integers.&lt;/li&gt;
&lt;li&gt;On Web, CSS pixels are integer-aligned per DPR.&lt;/li&gt;
&lt;li&gt;Decimal values simply don’t exist natively, so developers must round → making the original design intent meaningless.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Accessibility Considerations
&lt;/h2&gt;

&lt;p&gt;Accessibility (a11y) is often overlooked in the design-to-code pipeline, but &lt;strong&gt;inconsistent or fractional values can degrade accessibility in subtle but important ways&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Legibility of Text&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Fonts sized at decimals (e.g., &lt;code&gt;13.5px&lt;/code&gt;) may render inconsistently across platforms.&lt;/li&gt;
&lt;li&gt;On some browsers/devices, this causes text to appear slightly thinner or blurrier, impacting readability — especially for users with visual impairments.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Touch Targets and Hit Areas&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Accessibility guidelines (WCAG, Apple HIG, Material Design) require &lt;strong&gt;minimum touch targets&lt;/strong&gt; of 44×44px or 48×48dp.&lt;/li&gt;
&lt;li&gt;A button with fractional padding or inconsistent sizing may fall short of these thresholds, making it harder for users with motor disabilities to tap reliably.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Zoom and Scaling&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;When users zoom or enable larger text settings, fractional values often compound rounding errors, leading to misaligned UI elements.&lt;/li&gt;
&lt;li&gt;Sticking to consistent integer-based tokens ensures interfaces scale predictably.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 In short, &lt;strong&gt;clean integer-aligned values improve readability, usability, and compliance with accessibility standards.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Developer Experience Considerations
&lt;/h2&gt;

&lt;p&gt;From the developer’s perspective, inconsistent values directly impact &lt;strong&gt;workflow efficiency, maintainability, and scalability&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Implementation Friction&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Developers using frameworks like Tailwind, Chakra, or Material UI rely on token scales.&lt;/li&gt;
&lt;li&gt;If a design specifies &lt;code&gt;13.7px&lt;/code&gt; spacing, there’s no matching class/token. The developer must approximate, hardcode, or create an exception → wasting time and introducing inconsistencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Code Bloat&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Every arbitrary value creates a one-off CSS rule. Over time, this bloats the codebase and makes styles harder to manage.&lt;/li&gt;
&lt;li&gt;Token-based systems, by contrast, enable lean, reusable CSS.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Onboarding New Developers&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;With inconsistent values, new team members struggle to understand what’s “standard” vs. what’s an exception.&lt;/li&gt;
&lt;li&gt;With token-based, whole-number scales, the rules are predictable → reducing onboarding friction.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Collaboration Between Teams&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Consistency reduces “pixel pushing” back-and-forth between designers and developers.&lt;/li&gt;
&lt;li&gt;Developers can implement designs faster with fewer deviations, and QA testers spend less time verifying visual alignment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 In short, &lt;strong&gt;inconsistency slows developers down and creates technical debt, while consistency accelerates delivery and preserves design intent.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Power of Grid Systems
&lt;/h2&gt;

&lt;p&gt;Most design systems advocate for the &lt;strong&gt;4px or 8px grid system&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeps spacing, typography, and components consistent.&lt;/li&gt;
&lt;li&gt;Scales well across screen sizes and densities.&lt;/li&gt;
&lt;li&gt;Simplifies design handoff because designers and developers both speak the same scale.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Best Practices for Designers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use design tokens only&lt;/strong&gt; → stick to predefined scales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid fractional values&lt;/strong&gt; → round to the nearest token value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export icons in whole pixel dimensions&lt;/strong&gt; → 16px, 20px, 24px, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stick to a type scale&lt;/strong&gt; → 12, 14, 16, 20, 24 (no decimals).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaborate with developers early&lt;/strong&gt; → agree on token definitions to prevent drift.&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Decimals and inconsistent values may seem harmless in design tools, but they cause &lt;strong&gt;real technical problems&lt;/strong&gt; during implementation: blurry icons, rendering inconsistencies, bloated CSS, inaccessible touch targets, and broken design tokens.&lt;/p&gt;

&lt;p&gt;By adhering to &lt;strong&gt;whole-number values aligned with design tokens and grid systems&lt;/strong&gt;, designers and developers can ensure consistency, accessibility, scalability, and a smoother design-to-code workflow.&lt;/p&gt;

&lt;p&gt;Design is not just about how it looks in Figma—it’s about how well it translates into code and scales across platforms. And that translation depends heavily on &lt;strong&gt;consistency, precision, and respect for the system&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://design-tokens.github.io/community-group/format/" rel="noopener noreferrer"&gt;W3C Design Tokens Format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://m3.material.io/foundations/layout/applying-layout/overview" rel="noopener noreferrer"&gt;Material Design Guidelines - Layout Grid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/" rel="noopener noreferrer"&gt;Apple Human Interface Guidelines - Points and Pixels&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/resolution" rel="noopener noreferrer"&gt;MDN - Understanding CSS Pixel Density&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spec.fm/specifics/8-pt-grid" rel="noopener noreferrer"&gt;Eight-Point Grid System&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html" rel="noopener noreferrer"&gt;WCAG 2.2 - Target Size Minimum&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
    </item>
    <item>
      <title>📘 Essential Front-End Development Rules for Clean, Reusable Code</title>
      <dc:creator>i am message</dc:creator>
      <pubDate>Fri, 22 Aug 2025 14:06:56 +0000</pubDate>
      <link>https://dev.to/message/essential-front-end-development-rules-for-clean-reusable-code-1if7</link>
      <guid>https://dev.to/message/essential-front-end-development-rules-for-clean-reusable-code-1if7</guid>
      <description>&lt;p&gt;As frontend developers, one of the easiest mistakes we make early on is writing messy, inconsistent code, especially when it comes to styling. Between utility-first frameworks like Tailwind, component libraries like Ant Design, and old standbys like Bootstrap, it's easy to get carried away mixing tools or reinventing styles that already exist.&lt;/p&gt;

&lt;p&gt;The key to writing clean, maintainable, and reusable code is &lt;strong&gt;discipline&lt;/strong&gt;. Below are &lt;strong&gt;four fundamental rules&lt;/strong&gt; that can help new frontend developers stay consistent and avoid common pitfalls.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 1: Stick to One Library 🎯
&lt;/h2&gt;

&lt;p&gt;If you've chosen a UI library, whether it's Bootstrap, Tailwind CSS, Shadcn (which builds on Tailwind), or Ant Design, &lt;strong&gt;commit to it.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Matters:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Mixing multiple libraries creates unnecessary bloat and inconsistencies&lt;/li&gt;
&lt;li&gt;A single library ensures your design system is predictable and your project remains easy for others to read and maintain&lt;/li&gt;
&lt;li&gt;Most modern libraries are powerful enough to handle 90% of your use cases, so learn their feature set thoroughly before bringing in alternatives&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Implementation:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Choose one styling framework as your primary solution&lt;/li&gt;
&lt;li&gt;Resist the temptation to mix multiple frameworks unless absolutely necessary&lt;/li&gt;
&lt;li&gt;Maintain consistency across your entire project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;💡 Tip:&lt;/strong&gt; Explore the documentation deeply. Chances are, the utility or component you're about to write already exists in your chosen library.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 2: Exhaust the Utility Classes Before Writing Custom Styles 🔧
&lt;/h2&gt;

&lt;p&gt;Many beginners jump straight into writing new CSS rules for simple tweaks like spacing, typography, or colors. This leads to duplicated styles and harder-to-maintain code.&lt;/p&gt;

&lt;p&gt;Instead, &lt;strong&gt;trust the utility classes&lt;/strong&gt; your library provides.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Development&lt;/strong&gt;: Pre-built utilities speed up styling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design System Consistency&lt;/strong&gt;: Utilities enforce design constraints
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Responsive Design&lt;/strong&gt;: Most utilities include responsive variants&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced CSS Bloat&lt;/strong&gt;: No duplicate or conflicting custom styles&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Instead of writing:&lt;br&gt;
❌ &lt;strong&gt;Bad:&lt;/strong&gt;&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;.tiny-link&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;12px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
  &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bold&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;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"tiny-link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Read more&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;In Tailwind, you’d just use:&lt;/strong&gt;&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;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-xs font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Read more&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using utilities keeps everything consistent, semantic, and maintainable.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 3: Trust the Library Before Adding Custom Props or Overrides 🤝
&lt;/h2&gt;

&lt;p&gt;Libraries and HTML elements already provide sensible defaults and properties. Before you override them with custom props or inline styles, see if the library can handle it first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Principles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use library-provided components and their intended APIs&lt;/li&gt;
&lt;li&gt;Prefer library's sizing, spacing, and layout systems&lt;/li&gt;
&lt;li&gt;Utilize built-in responsive breakpoints and design tokens&lt;/li&gt;
&lt;li&gt;Add custom modifications only when library solutions are insufficient&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example 1: Button Component
&lt;/h3&gt;

&lt;p&gt;❌ &lt;strong&gt;Bad - Custom props that fight the system:&lt;/strong&gt;&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="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;BadButtonProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ReactNode&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="kr"&gt;number&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="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;textColor&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&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="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&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;BadButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FC&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BadButtonProps&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;backgroundColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#3b82f6&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;textColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#ffffff&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;borderRadius&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;fontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;padding&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;8px 16px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;onClick&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&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="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;style&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="na"&gt;width&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="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;height&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="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;textColor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;borderRadius&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="nx"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;fontSize&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="nx"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;px`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pointer&lt;/span&gt;&lt;span class="dl"&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;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&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;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Usage creates inconsistency&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BadButton&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#ef4444"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  Delete
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;BadButton&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;✅ &lt;strong&gt;Good - Extends HTML button with design system variants:&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;cn&lt;/span&gt; &lt;span class="p"&gt;}&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;@/lib/utils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;cva&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;VariantProps&lt;/span&gt; &lt;span class="p"&gt;}&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;class-variance-authority&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;buttonVariants&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cva&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:pointer-events-none&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;variants&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-primary text-primary-foreground hover:bg-primary/90&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;destructive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-destructive text-destructive-foreground hover:bg-destructive/90&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border border-input hover:bg-accent hover:text-accent-foreground&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-secondary text-secondary-foreground hover:bg-secondary/80&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;ghost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hover:bg-accent hover:text-accent-foreground&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;underline-offset-4 hover:underline text-primary&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-10 py-2 px-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;sm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-9 px-3 rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-11 px-8 rounded-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;h-10 w-10&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;defaultVariants&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;default&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;default&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="p"&gt;);&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;ButtonProps&lt;/span&gt;
  &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ButtonHTMLAttributes&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLButtonElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;VariantProps&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;buttonVariants&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;Button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FC&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ButtonProps&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&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="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buttonVariants&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="p"&gt;}))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;/&amp;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;// Usage follows design system&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"destructive"&lt;/span&gt; &lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lg"&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;"w-full"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  Delete Account
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&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;h3&gt;
  
  
  Example 2: SVG Icon Component
&lt;/h3&gt;

&lt;p&gt;❌ &lt;strong&gt;Bad - Custom props that bypass HTML attributes:&lt;/strong&gt;&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="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;BadIconProps&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="kr"&gt;number&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="kr"&gt;number&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="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;strokeWidth&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;className&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&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;BadTrashIcon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FC&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BadIconProps&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#000000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;strokeWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;className&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt;
      &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="na"&gt;viewBox&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"0 0 24 24"&lt;/span&gt;
      &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt;
      &lt;span class="na"&gt;xmlns&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt;
    &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;path&lt;/span&gt;
        &lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"&lt;/span&gt;
        &lt;span class="na"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;strokeWidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;strokeWidth&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;strokeLinecap&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
        &lt;span class="na"&gt;strokeLinejoin&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
      &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;&amp;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;// Usage creates inconsistent styling&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BadTrashIcon&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#ef4444"&lt;/span&gt; &lt;span class="na"&gt;strokeWidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;3&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;✅ &lt;strong&gt;Good - Extends SVG element and uses currentColor:&lt;/strong&gt;&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="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;forwardRef&lt;/span&gt; &lt;span class="p"&gt;}&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&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;IconProps&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SVGProps&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SVGSVGElement&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;TrashIcon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;forwardRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;SVGSVGElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;IconProps&lt;/span&gt;&lt;span class="o"&gt;&amp;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;className&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;ref&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="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt;
        &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="na"&gt;viewBox&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"0 0 24 24"&lt;/span&gt;
        &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt;
        &lt;span class="na"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"currentColor"&lt;/span&gt;
        &lt;span class="na"&gt;strokeWidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"2"&lt;/span&gt;
        &lt;span class="na"&gt;strokeLinecap&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
        &lt;span class="na"&gt;strokeLinejoin&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;path&lt;/span&gt; &lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;&amp;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;);&lt;/span&gt;

&lt;span class="nx"&gt;TrashIcon&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;displayName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;TrashIcon&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Usage works with design system classes&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TrashIcon&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;"h-6 w-6 text-red-500 hover:text-red-700"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Button&lt;/span&gt; &lt;span class="na"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"destructive"&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;"text-white"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TrashIcon&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;"h-4 w-4 mr-2"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  Delete
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&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;h3&gt;
  
  
  Why These Examples Matter:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Button Component Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses design system variants instead of arbitrary props&lt;/li&gt;
&lt;li&gt;Extends native HTML button attributes for accessibility&lt;/li&gt;
&lt;li&gt;Leverages Tailwind classes for consistent sizing and spacing&lt;/li&gt;
&lt;li&gt;Maintains type safety with proper TypeScript interfaces&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;SVG Icon Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;code&gt;currentColor&lt;/code&gt; to inherit text color from parent&lt;/li&gt;
&lt;li&gt;Extends all native SVG properties for maximum flexibility
&lt;/li&gt;
&lt;li&gt;Works seamlessly with utility classes for sizing and colors&lt;/li&gt;
&lt;li&gt;Can be styled contextually by parent components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach ensures you're working &lt;strong&gt;with&lt;/strong&gt; your design system instead of &lt;strong&gt;against&lt;/strong&gt; it. Override only when it's absolutely necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  Rule 4: Keep Components Small and Focused 🎯
&lt;/h2&gt;

&lt;p&gt;One of the best ways to keep your code reusable is to make sure your components do one thing well.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Principle:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A component should be focused on a single responsibility, whether that's rendering a button, a card, or a form input&lt;/li&gt;
&lt;li&gt;If a component grows too large or tries to do too much, split it into smaller subcomponents&lt;/li&gt;
&lt;li&gt;Smaller components are easier to test, reuse, and maintain&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Instead of creating a single massive &lt;code&gt;UserProfile&lt;/code&gt; component that handles layout, fetching data, and rendering UI:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;Better approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create smaller components like &lt;code&gt;UserAvatar&lt;/code&gt;, &lt;code&gt;UserBio&lt;/code&gt;, and &lt;code&gt;UserStats&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Compose them inside &lt;code&gt;UserProfile&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes your project easier to extend later without rewriting large chunks of code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why These Rules Matter 🚀
&lt;/h2&gt;

&lt;p&gt;Following these rules is essentially about &lt;strong&gt;discipline&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Your code looks the same no matter who writes it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability&lt;/strong&gt;: Anyone new to the project can jump in without learning multiple systems&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reusability&lt;/strong&gt;: Components remain generic and adaptable instead of being one-off hacks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Avoid bloated builds from multiple frameworks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team Collaboration&lt;/strong&gt;: Shared conventions make collaboration smoother&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Related Principles 📚
&lt;/h2&gt;

&lt;p&gt;These rules don't exist in isolation, they reflect established software principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Single Source of Truth (SSOT)&lt;/strong&gt;: One UI library as the canonical styling source&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't Repeat Yourself (DRY)&lt;/strong&gt;: Avoid writing styles that already exist&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Convention over Configuration&lt;/strong&gt;: Follow the conventions of your chosen library&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design System Discipline&lt;/strong&gt;: Stick to the system, extend only when needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Responsibility Principle (SRP)&lt;/strong&gt;: Each component should do one thing well&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Industry Standards:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Utility-First CSS&lt;/strong&gt; - Popularized by Tailwind CSS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Atomic Design&lt;/strong&gt; by Brad Frost - Building consistent UI components&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design Tokens&lt;/strong&gt; - Standardized design decisions in code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Component-Driven Development&lt;/strong&gt; - Building UIs from reusable components&lt;/li&gt;
&lt;/ul&gt;




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

&lt;p&gt;Clean frontend code isn't about avoiding creativity, it's about using the right tools the right way. By sticking to one library, fully exploring its utilities, trusting its conventions, and keeping components small and focused, you'll write code that's not only clean and reusable but also easy for your team to maintain and scale.&lt;/p&gt;

&lt;p&gt;Remember: &lt;strong&gt;discipline in following these rules early on will save you countless hours of refactoring later.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What's your biggest challenge when it comes to writing clean frontend code? Share your thoughts in the comments below! 👇&lt;/em&gt;&lt;/p&gt;




</description>
      <category>cleancoding</category>
      <category>frontend</category>
      <category>designsystem</category>
    </item>
    <item>
      <title>Set up github work/company email on mac together with your personal github account</title>
      <dc:creator>i am message</dc:creator>
      <pubDate>Wed, 09 Jul 2025 15:40:10 +0000</pubDate>
      <link>https://dev.to/message/set-up-github-workcompany-email-on-mac-together-with-your-personal-github-account-3lda</link>
      <guid>https://dev.to/message/set-up-github-workcompany-email-on-mac-together-with-your-personal-github-account-3lda</guid>
      <description>&lt;p&gt;Here’s a clean &lt;strong&gt;step-by-step outline&lt;/strong&gt; to &lt;strong&gt;generate and add an SSH key from your macbook to GitHub&lt;/strong&gt;, using your company email &lt;code&gt;your_personal_company_email&lt;/code&gt; as the identifier.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ &lt;strong&gt;Add SSH Key to GitHub – Step-by-Step&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Generate the SSH Key&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-b&lt;/span&gt; 4096 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_personal_company_email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command generates a new SSH key pair (used to securely authenticate with services like GitHub).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explanation of Each Part:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ssh-keygen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The command to generate a new SSH key.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-t rsa&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the &lt;strong&gt;type&lt;/strong&gt; of key to create. &lt;code&gt;rsa&lt;/code&gt; is a widely used algorithm.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-b 4096&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets the &lt;strong&gt;bit size&lt;/strong&gt; of the key. &lt;code&gt;4096&lt;/code&gt; bits is stronger than the default &lt;code&gt;2048&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-C "your_email@example.com"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adds a &lt;strong&gt;label (comment)&lt;/strong&gt; to the key file so you can identify it later — usually your email.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When prompted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enter file name&lt;/strong&gt;: give it a custom name like &lt;code&gt;your_name-company&lt;/code&gt; (e.g. &lt;code&gt;/Users/mac/.ssh/your_name-company&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Enter&lt;/strong&gt; to skip passphrase (or set one if you prefer extra security)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. &lt;strong&gt;Add the Key to SSH Agent&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The SSH agent is a background program that holds your private SSH keys in memory. This means you won’t need to enter your passphrase every time you use the key (e.g., when pushing to GitHub).&lt;/p&gt;

&lt;p&gt;First, start the SSH agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;ssh-agent &lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command starts the SSH agent and sets up the necessary environment variables so your terminal can communicate with it.&lt;/p&gt;

&lt;p&gt;Next, add your private key to the agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add ~/.ssh/your_name-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;your_name-company&lt;/code&gt; with the actual name of your private key file (not the &lt;code&gt;.pub&lt;/code&gt; one).&lt;/p&gt;

&lt;p&gt;Once added, the agent will remember your key for the current session, allowing passwordless SSH/Git operations.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. &lt;strong&gt;Copy the Public Key to Clipboard&lt;/strong&gt;
&lt;/h3&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pbcopy &amp;lt; ~/.ssh/your_name-company.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;This copies the SSH key to your clipboard.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  4. &lt;strong&gt;Add the Key to GitHub&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to: &lt;a href="https://github.com/settings/ssh/new" rel="noopener noreferrer"&gt;https://github.com/settings/ssh/new&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Title&lt;/strong&gt;: e.g. &lt;code&gt;MacBook - Company&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key&lt;/strong&gt;: paste the copied content (Cmd+V)&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;“Add SSH Key”&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  5. &lt;strong&gt;Update &lt;code&gt;~/.ssh/config&lt;/code&gt; File&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Open it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="c1"&gt;# GitHub for company&lt;/span&gt;
&lt;span class="k"&gt;Host&lt;/span&gt; github.com-company
  &lt;span class="k"&gt;HostName&lt;/span&gt; github.com
  &lt;span class="k"&gt;User&lt;/span&gt; git
  &lt;span class="k"&gt;IdentityFile&lt;/span&gt; ~/.ssh/your_name-company
  &lt;span class="k"&gt;IdentitiesOnly&lt;/span&gt; &lt;span class="no"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + O&lt;/code&gt;, then &lt;code&gt;Enter&lt;/code&gt; to save&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;Ctrl + X&lt;/code&gt; to exit&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. &lt;strong&gt;Test the Connection&lt;/strong&gt;
&lt;/h3&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com-company
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Hi your-username! You&lt;span class="s1"&gt;'ve successfully authenticated...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. &lt;strong&gt;Clone the Repo Using the Alias&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Use this to clone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com-company:company/repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  📚 Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh" rel="noopener noreferrer"&gt;GitHub Docs – Generating a new SSH key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ssh.com/academy/ssh/agent" rel="noopener noreferrer"&gt;Understanding ssh-agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/17846529/what-does-eval-ssh-agent-s-do" rel="noopener noreferrer"&gt;Stack Overflow – What does eval "$(ssh-agent -s)" do?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent" rel="noopener noreferrer"&gt;GitHub Docs: Generating a New SSH Key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-github" rel="noopener noreferrer"&gt;DigitalOcean: How To Use SSH Keys with GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/17846529/why-do-you-have-to-eval-ssh-agent" rel="noopener noreferrer"&gt;Stack Overflow: ssh-agent -s vs eval&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Semantic HTML Not &lt;div&gt;&lt;/div&gt; Soup: The Importance of Semantic HTML in Modern Web Development</title>
      <dc:creator>i am message</dc:creator>
      <pubDate>Mon, 02 Jan 2023 11:50:00 +0000</pubDate>
      <link>https://dev.to/message/importance-of-semantic-html-5387</link>
      <guid>https://dev.to/message/importance-of-semantic-html-5387</guid>
      <description>&lt;h2&gt;
  
  
  What is Semantic HTML?
&lt;/h2&gt;

&lt;p&gt;Semantic HTML refers to the use of HTML elements that carry inherent meaning and purpose, both for developers and for the technologies that consume web content such as browsers, search engines, and assistive tools like screen readers. Unlike non-semantic elements (e.g., &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;), semantic elements clearly describe their role in the document structure.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt; indicates introductory content or navigation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; represents closing content or metadata for a page or section.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; identifies independent, self-contained pieces of content such as blog posts or news stories.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; groups related content under a thematic division.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt; signals supplementary or tangential content, such as sidebars or callouts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By applying these elements correctly, developers create documents that are not only visually structured but also &lt;strong&gt;meaningfully structured&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Semantic HTML Matters
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Improved Accessibility&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Semantic HTML is foundational for &lt;strong&gt;web accessibility (a11y)&lt;/strong&gt;. Screen readers and assistive technologies rely on the semantic meaning of elements to help visually impaired users navigate a webpage. For example, a screen reader can announce when it enters an &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;, allowing users to skip to relevant sections.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="https://www.w3.org/WAI/standards-guidelines/" rel="noopener noreferrer"&gt;W3C Web Accessibility Initiative (WAI)&lt;/a&gt; emphasizes semantic HTML as a best practice for accessible design.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Better SEO and Search Engine Crawling&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Search engines use semantic elements to interpret the hierarchy and relevance of content. For example, wrapping content in &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; provides context that can improve how search engines classify and rank the content.&lt;/p&gt;

&lt;p&gt;In addition, semantic HTML enhances the effectiveness of &lt;strong&gt;structured data (Schema.org)&lt;/strong&gt;, which can lead to rich snippets in search results (e.g., article previews, FAQs, product details).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="https://developers.google.com/search/docs/fundamentals/seo-starter-guide" rel="noopener noreferrer"&gt;Google’s SEO Starter Guide&lt;/a&gt; stresses the importance of semantic markup for crawlability and ranking.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Maintainable and Scalable Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Semantic HTML improves developer experience by making the codebase more &lt;strong&gt;readable, maintainable, and collaborative&lt;/strong&gt;. A new developer reviewing a project will understand &lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; far more intuitively than a sea of nested &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; elements. This reduces onboarding time and the likelihood of errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Consistency Across Devices and Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Browsers, search engines, and assistive technologies have built-in behaviors for semantic elements. For instance, headings (&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; through &lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt;) automatically create a document outline, while &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; elements are identified as navigation landmarks. These consistent behaviors make web content more robust across devices and tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="https://html.spec.whatwg.org/multipage/" rel="noopener noreferrer"&gt;HTML Living Standard – WHATWG&lt;/a&gt; outlines semantic elements and their intended roles in document structure.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Practical Examples
&lt;/h2&gt;

&lt;p&gt;Consider the difference between these two snippets:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-semantic (div soup):&lt;/strong&gt;&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;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;My Blog&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"post"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Latest Post&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Semantic (clear meaning):&lt;/strong&gt;&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;header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Blog&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Latest Post&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second example not only conveys structure to developers but also communicates meaning to assistive technologies and search engines.&lt;/p&gt;




&lt;h2&gt;
  
  
  Semantic vs. Non-Semantic Elements
&lt;/h2&gt;

&lt;p&gt;Here’s a comparison of some common semantic elements and their non-semantic equivalents:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Semantic Element&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Non-Semantic Equivalent&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Problem with Non-Semantic Use&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;header&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Introduces content, page, or section header&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div id="header"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Loses meaning to screen readers/search engines&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Closing or metadata for a page/section&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div id="footer"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No structural significance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines primary navigation links&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div class="nav"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Search engines can’t identify navigation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Denotes the primary content of a page&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div id="main"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Harder for assistive tech to find main content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Self-contained, reusable content (blog post, news)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div class="article"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Treated as generic container&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Groups related content under a theme&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div class="section"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No semantic grouping, weak document outline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tangential or secondary content (sidebars)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div class="sidebar"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No distinction from main content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;–&lt;code&gt;&amp;lt;h6&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Headings that define hierarchy&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;div class="title"&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Breaks page outline, harms SEO&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This table demonstrates how &lt;strong&gt;semantics provide machine-readable meaning&lt;/strong&gt;, while non-semantic markup only provides styling hooks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Best Practices for Using Semantic HTML
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use headings in order (&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; → &lt;code&gt;&amp;lt;h2&amp;gt;&lt;/code&gt; → &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;):&lt;/strong&gt; Don’t skip levels; this ensures a proper document outline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reserve &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; for the main page title:&lt;/strong&gt; Each page should typically have only one &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; only once per page:&lt;/strong&gt; This represents the central content, not repeated sections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrap navigational links in &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt;:&lt;/strong&gt; Helps screen readers quickly locate menus.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer semantic elements over &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s and &lt;code&gt;&amp;lt;spans&amp;gt;&lt;/code&gt;:&lt;/strong&gt; Use &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;, etc., wherever they apply.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Combine with ARIA roles only when necessary:&lt;/strong&gt; Semantic HTML often eliminates the need for extra ARIA attributes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ensure &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; has a heading:&lt;/strong&gt; Each &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; should start with a heading for clarity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid misuse of &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; as a generic container:&lt;/strong&gt; Use &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; when grouping content purely for styling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always provide alt text for images (&lt;code&gt;&amp;lt;img alt="..."&amp;gt;&lt;/code&gt;):&lt;/strong&gt; This complements semantic markup for accessibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate HTML regularly:&lt;/strong&gt; Use &lt;a href="https://validator.w3.org/" rel="noopener noreferrer"&gt;W3C Validator&lt;/a&gt; to catch semantic and structural issues.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  The Bigger Picture: Accessibility, SEO, and DX
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility (A11y):&lt;/strong&gt; Semantic HTML is the baseline of WCAG compliance. Without it, ARIA roles and accessibility overlays are less effective.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO:&lt;/strong&gt; Semantic HTML provides the structural clarity that modern search algorithms use to evaluate content authority and relevance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Experience (DX):&lt;/strong&gt; Code readability and collaboration are improved, reducing cognitive load for developers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When semantic HTML is combined with CSS and JavaScript responsibly, it creates &lt;strong&gt;content that is meaningful, accessible, and discoverable&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Semantic HTML isn’t just about cleaner markup, it’s about building websites that are &lt;strong&gt;inclusive, future-proof, and search-friendly&lt;/strong&gt;. As developers, our goal should be to ensure that both humans and machines can understand and interact with the content meaningfully.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Use the right element for the right job.” – &lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Semantics#semantics_in_html" rel="noopener noreferrer"&gt;MDN Web Docs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By embracing semantic HTML, we’re not just writing code, we’re shaping the way people and technologies interact with the web.&lt;/p&gt;




&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Semantics#semantics_in_html" rel="noopener noreferrer"&gt;MDN Web Docs – Semantics in HTML&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/standards-guidelines/" rel="noopener noreferrer"&gt;W3C Web Accessibility Initiative (WAI)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/search/docs/fundamentals/seo-starter-guide" rel="noopener noreferrer"&gt;Google SEO Starter Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://html.spec.whatwg.org/multipage/" rel="noopener noreferrer"&gt;WHATWG HTML Living Standard&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://validator.w3.org/" rel="noopener noreferrer"&gt;W3C Validator – Markup Validation Service&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noopener noreferrer"&gt;Web Content Accessibility Guidelines (WCAG) Overview&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;




</description>
      <category>html</category>
      <category>webdev</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
