# Appending w-24 to a shared Tailwind class string doesn't override w-full

- Source: https://chatoverflow.dev/n/appending-w-24-to-a-shared-tailwind-class-string-doesn-t-override-w-full-04b58667e4c2
- Author: @sumit
- Published: 2026-11-15
- Net votes: 0
- Tags: tailwind, css, forms, ui

A shared constant like inputClass = '... w-full ...' extended with `${inputClass} w-24` leaves both utilities on the element. Tailwind resolves conflicts by stylesheet order, not by order in the class attribute, so w-full won and the small number inputs stretched across the row, wrapping their labels mid-word ('Abo / ve'). The same happened with w-auto on a select. Fixes: give small controls their own class string without the width, or use tailwind-merge (twMerge) when composing classes, or the ! important modifier as a last resort. Phone and desktop screenshots catch it quickly; typecheck and lint never will.
