tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Tailwind CSS Classes Not Working on Chrome for Android 14

Open VedantaKaushik opened this issue 1 year ago • 4 comments

What version of Tailwind CSS are you using? v4.0.4

What build tool (or framework) are you using? Next.js 15.1.6 with PostCSS 8.5.1

What version of Node.js are you using? v22.13.1

What browser are you using? Chrome (latest) and other Chromium-based browsers on Android 14

What operating system are you using? Android 14

Describe Your Issue

In my Next.js + Tailwind CSS project, I have encountered an issue where some Tailwind classes work in one component but fail in another, specifically on Chrome (and other Chromium-based browsers) on Android 14.

  • Observed Behavior:

The following class works correctly in one component but not in another:

<div className="font-semibold text-xl text-gray-800">{cardProps.total}</div>
  • The same class applies correctly on desktop and Firefox mobile, but not on Chrome for Android 14.

  • No errors appear in the console, but styles fail to apply.

Steps to Reproduce

  1. Open a Tailwind-powered webpage on Chrome for Android 14

  2. Compare the rendering of the following component:

<React.Fragment>
   <div className="flex justify-center items-center gap-2 sm:m-4 flex-col sm:w-96 w-64 sm:p-6 p-3 m-0 bg-white border border-gray-200 rounded-lg shadow">
     <div className="mb-2 text-2xl font-bold tracking-tight text-gray-800">
       <span>{cardProps.heading}</span>
     </div>
     <div className="font-semibold text-xl text-gray-800">
       <span>{cardProps.total}</span>
     </div>
   </div>
 </React.Fragment>
  1. Observe that one card applies styles correctly, while another does not display font-semibold text-xl text-gray-800 correctly.

  2. Test the same page in Firefox for Android or desktop Chrome → styles apply correctly.

VedantaKaushik avatar Feb 08 '25 08:02 VedantaKaushik

Seems Chrome on Andriod still with lower version, mine is v88, which dosen't support CSS @layer at-rule.

Instead of @import 'tailwindcss'; line with:

@import 'tailwindcss/theme.css';                                                                                                                                                                                                                
@import 'tailwindcss/preflight.css';                                                                                                                                                                                                            
@import 'tailwindcss/utilities.css'; 

which not using 'layer' might works, not fully.

I am waiting better solution for now too.

chunzi avatar Feb 08 '25 08:02 chunzi

I don't know if it's related but, hover States are not working too in Google Chrome 133 and Microsoft Edge 133

https://github.com/user-attachments/assets/8ae792a3-8248-443c-8d5a-865d87eaed4a

eugenioestrada avatar Feb 08 '25 09:02 eugenioestrada

@eugenioestrada, could it be this, https://github.com/tailwindlabs/tailwindcss/issues/16150#issuecomment-2628965257?

wongjn avatar Feb 08 '25 09:02 wongjn

What version of Tailwind CSS are you using? v4.0.4

What build tool (or framework) are you using? Next.js 15.1.6 with PostCSS 8.5.1

What version of Node.js are you using? v22.13.1

What browser are you using? Chrome (latest) and other Chromium-based browsers on Android 14

What operating system are you using? Android 14

Describe Your Issue

In my Next.js + Tailwind CSS project, I have encountered an issue where some Tailwind classes work in one component but fail in another, specifically on Chrome (and other Chromium-based browsers) on Android 14.

  • Observed Behavior:

The following class works correctly in one component but not in another:

<div className="font-semibold text-xl text-gray-800">{cardProps.total}</div>
  • The same class applies correctly on desktop and Firefox mobile, but not on Chrome for Android 14.
  • No errors appear in the console, but styles fail to apply.

Steps to Reproduce

  1. Open a Tailwind-powered webpage on Chrome for Android 14
  2. Compare the rendering of the following component:
<React.Fragment>
   <div className="flex justify-center items-center gap-2 sm:m-4 flex-col sm:w-96 w-64 sm:p-6 p-3 m-0 bg-white border border-gray-200 rounded-lg shadow">
     <div className="mb-2 text-2xl font-bold tracking-tight text-gray-800">
       <span>{cardProps.heading}</span>
     </div>
     <div className="font-semibold text-xl text-gray-800">
       <span>{cardProps.total}</span>
     </div>
   </div>
 </React.Fragment>
  1. Observe that one card applies styles correctly, while another does not display font-semibold text-xl text-gray-800 correctly.
  2. Test the same page in Firefox for Android or desktop Chrome → styles apply correctly.

yes, facing the same.

savlonbhoi avatar Feb 08 '25 18:02 savlonbhoi