Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Icon/Text inside .input wrapper doesn't work as it's shown in demo #3003

Closed
webceyhan opened this issue Apr 28, 2024 · 4 comments
Closed

Comments

@webceyhan
Copy link

webceyhan commented Apr 28, 2024

What version of daisyUI are you using?

4.10.2

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://daisyui.com/components/input/#text-input-with-icon-inside

Describe your issue

 <label class="input input-bordered flex items-center gap-2">
    test
    <input ref="input" type="text" class="grow" />
  </label>
`

<img width="1518" alt="Screenshot 2024-04-28 at 19 00 43" src="https://github.com/saadeghi/daisyui/assets/3739981/518be1c0-c621-4444-ae61-0e6462241bb0">
Copy link

Thank you @webceyhan for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

@saadeghi
Copy link
Owner

It's working like the demo: https://play.tailwindcss.com/tpUPPhaV4P 🤔
Are you sure that border is not coming from another CSS plugin? like @tailwindcss/forms?

@webceyhan
Copy link
Author

Indeed, you're right! I've removed the forms plugin and it's fixed.
So basically daisyui is not compatible with tailwind plugins?

Maybe you could mention this in the docs to avoid further confusion?

@saadeghi
Copy link
Owner

It's important to know what exactly a plugin does when we're adding them.

tailwindcss-forms by default, applies opinionated styles to all form elements in the page. Without using any class names. It targets the <input> tags.
The border you were seeing was coming from tailwindcss-forms and there's nothing daisyUI can do about it because tailwindcss-forms is doing its job as it's supposed to do.

So, before using tailwindcss-forms I would ask myself "do I need styles on all input tags on my page"? 😅

Thankfully, tailwindcss-forms has a config to opt out of applying styles to everything by default, and instead applying styles to specific form elements using the class strategy.

daisyUI is compatible with tailwindcss-forms if you use their class strategy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants