svelte-material-ui icon indicating copy to clipboard operation
svelte-material-ui copied to clipboard

Adding Tailwind adds border inside focused Textfield elements

Open JohanHeyvaert opened this issue 3 years ago • 4 comments

Describe the bug After adding Tailwind to the project (SvelteKit + smui) the TextFields get two inside vertical borders when focused. These vertical borders are not shown when the textfield is not focused.

To Reproduce Steps to reproduce the behavior:

  1. Add Tailwind to a SvelteKit project that uses smui Textfield by following these instructions: https://tailwindcss.com/docs/guides/sveltekit
  2. Now focus a Textfield and the problem appears

Expected behavior The vertical borders inside the input should not be shown.

Screenshots Cf. screenshot: image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 107

I was able to solve the problem by adding this style to my general css file:

/* Fix: smui + tailwind adds left & right borders within textfields */
.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch {
    border-left: 0;
    border-right: 0;
}

JohanHeyvaert avatar Nov 23 '22 12:11 JohanHeyvaert

I have the same issue. Thanks for the fix.

FaCe2FaCe avatar Nov 23 '22 15:11 FaCe2FaCe

I have seen this issue when using TextField to wrap an input element.

mrmikardo avatar Feb 09 '23 23:02 mrmikardo

Thanks for the fix! I'm wondering if I should put this in the documentation, because including this code in SMUI might have unintended side effects down the road.

hperrin avatar Feb 09 '23 23:02 hperrin

@hperrin my gut feeling is that it would be good to have a "using SMUI with Tailwind" section in the docs 🙂

mrmikardo avatar Feb 09 '23 23:02 mrmikardo