Skip to content

Padding and alignments of buttons, etc are weird when using styled + tailwind #34

@elburro1887

Description

@elburro1887

When using Prime React with Styled + Tailwind options (Vite and Nextjs, for example), the padding on the button and the alignment of the icons/ other components is different than what is shown on the documentation page.

When using the original values in vite-styled-tailwind/src/index.css:

font-size: 16px;
line-height: 24px;

The button and the input field have excessive padding, the icon in the cutton is too low, radio buttons look normal.

Screenshot 2024-07-30 at 00 21 33

Now I change the values in in vite-styled-tailwind/src/index.css:

font-size: 14px;
line-height: 18px;

to match font size: 14px used the Button Component documentation page (https://primereact.org/button/). line-height is not used there, interestingly enough.

As one can see, the buttons look different, also the alignment of the radio buttons and the icon inside the button is off:

Screenshot 2024-07-30 at 00 23 37

There seems to be some issue here where Tailwind is interfering with the layout, can anyone help out? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions