skip to Main Content

I’m using tailwindcss 3.3.3 and having an issue with tailwind arbitrary value specificity that it does not override the generic value.
For example, I have this element <div className="w-full w-[80px]">Sample</div>.
I expect that div will have 80px width but I got width 100% is taking precedence over width 80px.

2

Answers


  1. what do you get if you try to put w-[80px] first and then w-full ?

    Login or Signup to reply.
  2. You can use an arbitrary variant to force the 80px width to apply.

    <div className="w-full [&]:w-[80px]">Sample</div>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search