<?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: Shashank Thigale</title>
    <description>The latest articles on DEV Community by Shashank Thigale (@shashankthigale11).</description>
    <link>https://dev.to/shashankthigale11</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%2F4268010%2Fd39624f6-12b0-4173-b7b1-e583c4307cdf.jpg</url>
      <title>DEV Community: Shashank Thigale</title>
      <link>https://dev.to/shashankthigale11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shashankthigale11"/>
    <language>en</language>
    <item>
      <title>text-wrap pretty made my pills overflow on phones</title>
      <dc:creator>Shashank Thigale</dc:creator>
      <pubDate>Fri, 27 Nov 2026 03:26:37 +0000</pubDate>
      <link>https://dev.to/shashankthigale11/text-wrap-pretty-made-my-pills-overflow-on-phones-5cci</link>
      <guid>https://dev.to/shashankthigale11/text-wrap-pretty-made-my-pills-overflow-on-phones-5cci</guid>
      <description>&lt;p&gt;In October, Framer's Marketplace review took four of my templates down. One of the problems they flagged looked tiny: on phones, the text in some pills and price tags ran past the edge of the pill. A price like "€6,900 / week" spilled out of its card.&lt;/p&gt;

&lt;p&gt;The cause was a setting I had turned on to make text look better.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;In Framer, text styles have a Text Wrap option: default, balance or pretty. Balance evens out line lengths, and pretty avoids a single word stranded on the last line. Both map to the CSS &lt;code&gt;text-wrap&lt;/code&gt; property, and both make headings and paragraphs look more polished.&lt;/p&gt;

&lt;p&gt;So I had set pretty wrap on almost every text style, including the label and button styles. Those styles are used inside pills that size themselves to their text, which in Framer means auto width (in CSS terms, the pill shrinks to fit its content).&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;p&gt;On desktop everything looked fine. On a narrow phone, where a pill had to wrap or squeeze, the text stopped fitting inside it. Framer publishes these text layers with &lt;code&gt;white-space: pre-wrap&lt;/code&gt;, and with balance or pretty wrap on top, the auto-width pill ended up sized by its longest word rather than by its text. The rest of the text overflowed the pill instead of the pill growing or the text wrapping cleanly.&lt;/p&gt;

&lt;p&gt;It only showed at small widths, so I never saw it at the three breakpoints I usually looked at.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Set Text Wrap back to default on the label and button styles. That fixed every pill at once, because they all shared those styles.&lt;/p&gt;

&lt;p&gt;In plain CSS terms:&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="cm"&gt;/* Pills, tags, buttons: let them wrap normally */&lt;/span&gt;
&lt;span class="nc"&gt;.pill&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;.tag&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-wrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;wrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/* Keep the nicer wrapping where it helps: headings in containers with a set width */&lt;/span&gt;
&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;text-wrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;balance&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;I still use balance on big headings, where a lone word on the last line looks bad and the container's width doesn't depend on the text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to catch it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Check your published site at a 320 px phone width, not just the breakpoints your tool gives you. Small phones show wrapping problems first.&lt;/li&gt;
&lt;li&gt;Look at every component that sizes itself to its content: pills, tags, chips, buttons and badges.&lt;/li&gt;
&lt;li&gt;Change shared text styles carefully. One setting on a style touches every layer that uses it, which is how one checkbox broke pills across a whole template.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other two things that review flagged were a hover zoom that grew past its frame and buttons that linked to a deleted page. I wrote all three up, together with the rest of my pre-submission checks, here: &lt;a href="https://qa.shashankthigale.com/framer-template-checklist" rel="noopener noreferrer"&gt;the Framer template checklist I use before every submission&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Where do you use &lt;code&gt;text-wrap: balance&lt;/code&gt; or &lt;code&gt;pretty&lt;/code&gt;, and have you seen it misbehave?&lt;/p&gt;

</description>
      <category>css</category>
      <category>framer</category>
      <category>webdev</category>
      <category>design</category>
    </item>
    <item>
      <title>Quotes in a style tag broke hydration in my Framer code component</title>
      <dc:creator>Shashank Thigale</dc:creator>
      <pubDate>Fri, 27 Nov 2026 03:25:12 +0000</pubDate>
      <link>https://dev.to/shashankthigale11/quotes-in-a-style-tag-broke-hydration-in-my-framer-code-component-5e2n</link>
      <guid>https://dev.to/shashankthigale11/quotes-in-a-style-tag-broke-hydration-in-my-framer-code-component-5e2n</guid>
      <description>&lt;p&gt;I sell Framer code components, and one of them worked perfectly in the editor, then threw a hydration error on the published site. The page still rendered, but the console showed React error #425 ("text content does not match server-rendered HTML").&lt;/p&gt;

&lt;p&gt;The cause was two kinds of characters in the CSS: quotes and &lt;code&gt;&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Framer code components are React components. A common way to ship their styles is a &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; element with a template string inside:&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;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Accordion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="p"&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;div&lt;/span&gt; &lt;span class="n"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"acc"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`
                .acc [data-state="open"] .panel { display: block; }
                .acc &amp;gt; .item { border-top: 1px solid #ddd; }
            `&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* ... */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;div&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the editor this is fine, because the editor renders on the client only. A published Framer site renders the page on the server first and then hydrates it in the browser, and that's where it broke.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;p&gt;On the server, the text inside &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; was escaped like any other text: &lt;code&gt;"&lt;/code&gt; became &lt;code&gt;&amp;amp;quot;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; became &lt;code&gt;&amp;amp;gt;&lt;/code&gt;. In the browser, &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; is a raw text element, so those entities are never decoded. The browser kept &lt;code&gt;&amp;amp;quot;&lt;/code&gt; as literal characters in the CSS.&lt;/p&gt;

&lt;p&gt;So the server HTML and the client render disagreed about the style text, React reported the mismatch, and the selectors with escaped characters stopped matching anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;Write the CSS so it has nothing to escape:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`
    .acc [data-state=open] .panel { display: block; }
    .acc .item { border-top: 1px solid #ddd; }
`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Attribute selectors don't need quotes when the value is a plain word: &lt;code&gt;[data-state=open]&lt;/code&gt; works the same as &lt;code&gt;[data-state="open"]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Replace the child combinator &lt;code&gt;&amp;gt;&lt;/code&gt; with a descendant selector or a class on the child.&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;content: "..."&lt;/code&gt; strings. If you need generated text, put it in the markup instead.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JavaScript inside &lt;code&gt;${...}&lt;/code&gt; in the template string is fine, because it runs before React ever sees the text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to catch it before buyers do
&lt;/h2&gt;

&lt;p&gt;The editor will never show this bug. Publish the site, open it in a normal browser tab and check the console for React's "recoverable error" messages, numbers #418, #421, #423 and #425. Those are hydration mismatches. If you see one, look for anything your component renders differently on the server than on the client: escaped text, dates, random ids or &lt;code&gt;window&lt;/code&gt; checks.&lt;/p&gt;

&lt;p&gt;A related trap: don't build class names or CSS selectors from &lt;code&gt;useId()&lt;/code&gt;. Framer's server render adds copies of components for breakpoint variants, so the ids can shift between server and client.&lt;/p&gt;

&lt;p&gt;I keep the rest of what I check before submitting a template or component in one place: &lt;a href="https://qa.shashankthigale.com/framer-template-checklist" rel="noopener noreferrer"&gt;the Framer template checklist I use before every submission&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have you hit a hydration error that only showed up on the live site? What caused it?&lt;/p&gt;

</description>
      <category>framer</category>
      <category>react</category>
      <category>css</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
