tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.27k stars 4.22k forks source link

Add `color` to form reset snippet #15064

Closed philipp-spiess closed 23 hours ago

philipp-spiess commented 1 day ago

While testing the latest alpha release across Tailwind v3 projects, we noticed one regression in relation to the default color of <button> elements. In v3, the reset would change the default to inherit but in v4 we would not include it in the reset snippet inserted by the upgrade too.

This PR changes the upgrade snippet to include it:

 /*
   In Tailwind CSS v4, basic styles are applied to form elements by default. To
   maintain compatibility with v3, the following resets have been added:
 */
 @layer base {
   input,
   textarea,
   select,
   button {
     border: 0px solid;
     border-radius: 0;
     padding: 0;
+    color: inherit;
     background-color: transparent;
   }
 }

This PR also ensures that there's a newline between the two code snippets.

Test Plan

Before

image

After

Screenshot 2024-11-21 at 15 42 58