<?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: Dominik Krol</title>
    <description>The latest articles on DEV Community by Dominik Krol (@krolbuilds).</description>
    <link>https://dev.to/krolbuilds</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%2F4272478%2Fbab1c98c-4019-4942-8b12-06c3fbc4835a.png</url>
      <title>DEV Community: Dominik Krol</title>
      <link>https://dev.to/krolbuilds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krolbuilds"/>
    <language>en</language>
    <item>
      <title>Why UI Screenshots Make Cursor &amp; Claude Hallucinate (And How I Built a 64KB Shadow-DOM Inspector to Fix It)</title>
      <dc:creator>Dominik Krol</dc:creator>
      <pubDate>Sun, 29 Nov 2026 14:51:07 +0000</pubDate>
      <link>https://dev.to/krolbuilds/why-ui-screenshots-make-cursor-claude-hallucinate-and-how-i-built-a-64kb-shadow-dom-inspector-to-1dhh</link>
      <guid>https://dev.to/krolbuilds/why-ui-screenshots-make-cursor-claude-hallucinate-and-how-i-built-a-64kb-shadow-dom-inspector-to-1dhh</guid>
      <description>&lt;p&gt;Whenever I see a clean bento card, navbar, or pricing layout on a site like Linear or Stripe and want to understand how it's built—or rebuild a similar pattern in my own app—two things always break the flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Browser DevTools dumps 150–200+ computed CSS lines&lt;/strong&gt; full of inherited defaults instead of clean utility classes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screenshots make Cursor, Claude Code, and v0 guess wrong.&lt;/strong&gt; Vision models eyeball &lt;code&gt;padding: 22px&lt;/code&gt; as &lt;code&gt;p-8&lt;/code&gt;, miss &lt;code&gt;-0.02em&lt;/code&gt; font tracking, invent random hex grays, and flatten nested flexbox grids.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So over the past weeks (I'm a 17-year-old indie dev in Sweden), I built &lt;strong&gt;PRISM CSS&lt;/strong&gt;—a ~64KB, zero-dependency vanilla JS inspection engine that runs 100% locally inside an isolated Shadow DOM.&lt;/p&gt;




&lt;h3&gt;
  
  
  How It Works Under the Hood
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. 60fps &lt;code&gt;requestAnimationFrame&lt;/code&gt; Overlay Inside an Isolated Shadow DOM
&lt;/h4&gt;

&lt;p&gt;Injecting inspector styles directly into a live website usually mutates or breaks the host page's CSS. PRISM mounts its entire HUD, box-model laser overlays, and dock inside an isolated Shadow root so host styles never bleed in—and PRISM never dirties the page's DOM.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Translating Computed Styles -&amp;gt; Clean Tailwind v4 + JSX
&lt;/h4&gt;

&lt;p&gt;Instead of dumping &lt;code&gt;getComputedStyle()&lt;/code&gt; verbatim, the engine compares an element against baseline tag defaults, collapses directional shorthands (&lt;code&gt;padding-top/right/bottom/left&lt;/code&gt; -&amp;gt; &lt;code&gt;p-6&lt;/code&gt;), snaps values to standard Tailwind scales (falling back to arbitrary &lt;code&gt;rounded-[14px]&lt;/code&gt; or &lt;code&gt;bg-[#0D1122]&lt;/code&gt; only when exact precision matters), and outputs clean React/JSX or HTML:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
jsx
&amp;lt;div className="flex flex-col gap-4 p-6 rounded-2xl bg-[#0D1122] border border-white/10 shadow-2xl"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>tailwindcss</category>
      <category>css</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
