<?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: Pico Labs</title>
    <description>The latest articles on DEV Community by Pico Labs (@picolabs).</description>
    <link>https://dev.to/picolabs</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%2F4215421%2F0161dc29-b76b-45e9-b91b-386790982565.png</url>
      <title>DEV Community: Pico Labs</title>
      <link>https://dev.to/picolabs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/picolabs"/>
    <language>en</language>
    <item>
      <title>Claude Code kept hardcoding w-[232px] on my sidebar links until I started feeding it the parent's flex rules</title>
      <dc:creator>Pico Labs</dc:creator>
      <pubDate>Thu, 29 Oct 2026 13:34:51 +0000</pubDate>
      <link>https://dev.to/picolabs/claude-code-kept-hardcoding-w-232px-on-my-sidebar-links-until-i-started-feeding-it-the-parents-l19</link>
      <guid>https://dev.to/picolabs/claude-code-kept-hardcoding-w-232px-on-my-sidebar-links-until-i-started-feeding-it-the-parents-l19</guid>
      <description>&lt;p&gt;If you paste a screenshot of a sidebar into Claude Code or Cursor and ask for the same nav item, you usually get &lt;code&gt;w-[232px]&lt;/code&gt; and a fresh &lt;code&gt;flex&lt;/code&gt; wrapper. The screenshot shows a 232px wide link. It doesn't show that the link fills a &lt;code&gt;flex-col&lt;/code&gt; nav with &lt;code&gt;align-items: stretch&lt;/code&gt;, so the model copies the pixel width and the layout stops flexing.&lt;/p&gt;

&lt;p&gt;Copying computed styles out of DevTools has the opposite problem. You get a few hundred properties for the element, most of them browser defaults, and nothing at all about the container it sits in.&lt;/p&gt;

&lt;p&gt;What works better is pasting the parent's layout explicitly, plus the element's rendered box and only its non-default CSS. Here's that same nav link formatted as a prompt block:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;### UI Element: a.nav-item.is-active
- Selector: aside.sidebar &amp;gt; nav &amp;gt; a.nav-item.is-active
- Box: 232x36 at (12, 208)
- Parent nav: display: flex; flex-direction: column; align-items: stretch; gap: 2px
- Children: svg.icon, span.label, span.badge
- Text: "Billing and invoices 3"

Tailwind v4: flex flex-row items-center gap-2 px-3 w-full h-9 text-sm font-medium leading-5 text-[#f4f4f5] bg-[#27272a] rounded-md

Computed CSS (non-default):
display: flex; flex-direction: row; align-items: center; gap: 8px;
padding: 0px 12px; width: 100%; height: 36px; font-size: 14px;
font-weight: 500; line-height: 20px; color: rgb(244, 244, 245);
background-color: rgb(39, 39, 42); border-radius: 6px;

Fix / Refactor this element: keep the parent layout constraints, use the Tailwind v4 classes above, and apply:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The width comes out as &lt;code&gt;w-full&lt;/code&gt; because the link's width matches the nav's content box. With the parent's flex column spelled out, the model has a reason to keep it instead of adding a wrapper.&lt;/p&gt;

&lt;p&gt;I wrapped this into a tiny 356-line Manifest V3 Chrome extension (&lt;code&gt;activeTab&lt;/code&gt; only, no backend, 100% local in-browser execution): hit "Pick Element on Page", click an element, and it copies that block.&lt;/p&gt;

&lt;p&gt;Site: &lt;a href="https://picolabs.app" rel="noopener noreferrer"&gt;https://picolabs.app&lt;/a&gt;&lt;br&gt;
Chrome Web Store (includes 5 free captures): &lt;a href="https://chromewebstore.google.com/detail/iokjpoihcpmmdfajnjmlghcclgdlmpgi" rel="noopener noreferrer"&gt;https://chromewebstore.google.com/detail/iokjpoihcpmmdfajnjmlghcclgdlmpgi&lt;/a&gt;&lt;/p&gt;

</description>
      <category>claude</category>
      <category>cursor</category>
      <category>tailwindcss</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
