<?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: Hao Wu</title>
    <description>The latest articles on DEV Community by Hao Wu (@_a2d6b6a6361aff5ae214a5).</description>
    <link>https://dev.to/_a2d6b6a6361aff5ae214a5</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%2F4197016%2F462bc862-66e9-41cc-848c-718a66d4be08.png</url>
      <title>DEV Community: Hao Wu</title>
      <link>https://dev.to/_a2d6b6a6361aff5ae214a5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_a2d6b6a6361aff5ae214a5"/>
    <language>en</language>
    <item>
      <title>A copied button looks almost right? Check all four corners.</title>
      <dc:creator>Hao Wu</dc:creator>
      <pubDate>Sun, 25 Oct 2026 15:19:04 +0000</pubDate>
      <link>https://dev.to/_a2d6b6a6361aff5ae214a5/a-copied-button-looks-almost-right-check-all-four-corners-4l75</link>
      <guid>https://dev.to/_a2d6b6a6361aff5ae214a5/a-copied-button-looks-almost-right-check-all-four-corners-4l75</guid>
      <description>&lt;p&gt;The text, background and spacing match, but a copied button still feels wrong. Before changing its shadow, check whether you accidentally turned four different corner radii into one.&lt;/p&gt;

&lt;p&gt;This is a small shape error that is easy to miss when translating a reference into a reusable component. It is also easy to reproduce without installing a tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce the difference
&lt;/h2&gt;

&lt;p&gt;Paste this into an HTML file. Both buttons have the same dimensions, border, font and colors. Only the radius changes:&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;class=&lt;/span&gt;&lt;span class="s"&gt;"examples"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"action reference"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Continue&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"action uniform"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Continue&lt;span class="nt"&gt;&amp;lt;/button&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;style&amp;gt;&lt;/span&gt;
  &lt;span class="nc"&gt;.examples&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="nb"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;flex-wrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;wrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.action&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;312px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100px&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="nx"&gt;#4937ad&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="nx"&gt;#6550df&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="nx"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;font&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;600&lt;/span&gt; &lt;span class="m"&gt;25px&lt;/span&gt; &lt;span class="n"&gt;system-ui&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.reference&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32px&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt; &lt;span class="m"&gt;24px&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.uniform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;16px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first shape is deliberately asymmetric. The second is a reasonable-looking rounded button, but it is a different shape. This comparison is an original browser-rendered example, not a claim that a particular framework or copying tool produced the mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the four values in order
&lt;/h2&gt;

&lt;p&gt;With four values, &lt;code&gt;border-radius&lt;/code&gt; follows this order: top-left, top-right, bottom-right, bottom-left. A single value applies to all four corners.&lt;/p&gt;

&lt;p&gt;If the shorthand is hard to read, inspect the individual computed properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.reference&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;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;topLeft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderTopLeftRadius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;topRight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderTopRightRadius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;bottomRight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderBottomRightRadius&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;bottomLeft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderBottomLeftRadius&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this example, the result is &lt;code&gt;32px&lt;/code&gt;, &lt;code&gt;8px&lt;/code&gt;, &lt;code&gt;24px&lt;/code&gt;, &lt;code&gt;4px&lt;/code&gt;. In DevTools, use the Computed panel to read the result and the Styles panel to find the winning declarations. A later shorthand can reset individual corners you set earlier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adapt the shape deliberately
&lt;/h2&gt;

&lt;p&gt;If you want this exact reference shape, keep all four values. If your design system calls for a uniform radius, choose that intentionally. The goal is to understand the difference before making the change.&lt;/p&gt;

&lt;p&gt;With Tailwind, do the same comparison using the corner-specific utilities supported by your installed version. Do not replace an asymmetric shape with a generic rounded utility simply because the class name looks close. Theme tokens can also change the actual values behind a familiar utility name.&lt;/p&gt;

&lt;p&gt;Check at the intended dimensions and viewport. Percentage radii, elliptical radii and large values can behave differently as the box changes size. Matching the four values in this fixed-size example does not establish that every responsive size, focus state or hover state is finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short check before shipping
&lt;/h2&gt;

&lt;p&gt;Compare the four corner values first, then the border width and color. Test the result in your destination layout, where fonts, dimensions and inherited styles can differ. Keep the component's accessible name and visible keyboard focus when moving from a visual example to production.&lt;/p&gt;

&lt;p&gt;You can follow this entire workflow with browser DevTools. Read the computed corner values, trace the declarations that produced them, then compare your component in its own layout.&lt;/p&gt;

&lt;p&gt;Which detail most often makes a copied component look wrong: corners, borders, fonts or spacing? Please describe your own example without sharing client or private pages.&lt;/p&gt;

&lt;p&gt;Disclosure: this article and its original example used AI assistance. The four-corner example and comparison image were checked in a browser.&lt;/p&gt;

&lt;p&gt;Technical reference: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/border-radius" rel="noopener noreferrer"&gt;MDN border-radius&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Give your coding assistant a design brief, not just a screenshot</title>
      <dc:creator>Hao Wu</dc:creator>
      <pubDate>Tue, 20 Oct 2026 23:32:50 +0000</pubDate>
      <link>https://dev.to/_a2d6b6a6361aff5ae214a5/give-your-coding-assistant-a-design-brief-not-just-a-screenshot-13k4</link>
      <guid>https://dev.to/_a2d6b6a6361aff5ae214a5/give-your-coding-assistant-a-design-brief-not-just-a-screenshot-13k4</guid>
      <description>&lt;p&gt;A screenshot can show a coding assistant the shape of a design. A short brief with actual colors, typography and spacing gives it values it can work with. You can collect those values with browser DevTools; a CSS inspection extension can reduce some of the clicking.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm working on Stylegrab, the extension used in the accompanying demo. The workflow below also works manually.&lt;/p&gt;

&lt;p&gt;Editorial disclosure: this article was prepared with AI assistance. The examples and product demo use our own sample page; the extension does not call an AI model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose the part of the reference that matters
&lt;/h3&gt;

&lt;p&gt;Start with a page you own or have permission to reuse. Pick one component and a small set of visual rules: a page background, text and accent colors, body and heading type, common spacing and corner radii. Keep your own product's content and identity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Read rendered values as well as source rules
&lt;/h3&gt;

&lt;p&gt;The declaration with the highest selector specificity doesn't always win. Cascade layers, importance and other parts of the cascade come first. In DevTools, use the Computed panel to check the final value before copying it. For a tool, this is a useful regression test:&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;@layer&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;overrides&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@layer&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;#example&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="nx"&gt;red&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="k"&gt;@layer&lt;/span&gt; &lt;span class="n"&gt;overrides&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;.example&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="nx"&gt;blue&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;p&gt;For &lt;code&gt;&amp;lt;div id="example" class="example"&amp;gt;&lt;/code&gt;, the normal declaration in the later layer wins: blue. A copier that sorts only by selector specificity will give you the wrong starting point.&lt;/p&gt;

&lt;h3&gt;
  
  
  Write a compact brief
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use these reference values for our settings panel:
Background #0E1016; surface #171B24.
Text #E7E9EE; secondary text #A6ACBA; accent #7C6CFF.
Body: system sans-serif, 16px, line-height 1.5.
Heading: 28px, weight 700.
Spacing: 8px / 16px / 24px. Cards: 12px radius.
Keep our own copy and product identity.
Verify contrast and keyboard focus.
Check the result at 390px and 1280px widths.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are illustrative values. Replace them with the values you actually need, and compare them with your project's existing design tokens.&lt;/p&gt;

&lt;h3&gt;
  
  
  Export a component as a starting point
&lt;/h3&gt;

&lt;p&gt;A static HTML/CSS export can help with a button or card. It doesn't bring along the application's state, JavaScript interactions or all responsive rules. Check asymmetric borders and radii too: four different corners cannot be represented by one uniform &lt;code&gt;rounded&lt;/code&gt; class.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify in the destination page
&lt;/h3&gt;

&lt;p&gt;Check the narrow layout, focus and hover states, text contrast, and the influence of your own theme. With Tailwind, make sure the generated classes are included in your build and that your theme hasn't changed the meaning of a named utility.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://getstylegrab.com/copy-css-for-ai?utm_source=dev&amp;amp;utm_medium=community&amp;amp;utm_campaign=design-brief" rel="noopener noreferrer"&gt;Stylegrab guide&lt;/a&gt; includes the workflow and demo. The Chrome extension is available from the &lt;a href="https://chromewebstore.google.com/detail/bbacodnepolimendegnfedicnmdpanfm" rel="noopener noreferrer"&gt;Chrome Web Store&lt;/a&gt;. Free inspection and CSS copying are available; each Pro action includes three daily trials. Pro is available from the official website for $19 once, for one person on up to three browsers, with version 1.x updates and a 14-day refund policy. Tax is calculated at checkout. After purchase, use the license key from your receipt email to activate Pro in the existing extension. Current availability and purchase details: &lt;a href="https://getstylegrab.com/#pricing" rel="noopener noreferrer"&gt;https://getstylegrab.com/#pricing&lt;/a&gt; .&lt;/p&gt;

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