-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Button (Tailwind): Theming Documentation is missing attributes for button without label #5526
Comments
Please fork the CodeSandbox project or Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days. |
Codesandbox example updated in the issue. We replaced the default styling of the button with the theming presented in the documentation. If you inspect the button you can see a gap next to the icon. We suspect it is caused by the label tag which it still not invisible. The documentation of the button theming might be insufficient. |
This is our current workaround to hide the label when no text is used. |
Where did you put |
I've updated the sandbox. You can find the adjustments where the comment "HERE" is. By default the tailwind theme has the additional classes for the button "invisible" and "w-0" where "w-0" is the crucial class for hiding the label. "invisible" only hides the element but it still takes up space in the DOM. It could also be "hidden". |
Got it the code already has this label: ({ props }) => ({
className: classNames(
'flex-1',
'duration-200',
'font-bold',
{
'hover:underline': props.link
},
{ 'invisible w-0': props.label == null }
)
}) |
Describe the bug
The documentation describes a different button as used in the library. By default a labeless button hides the label span. But when importing the theming from the documentation, this feature is missing and the label span is rendered. Resulting in an uncentered icon in the button.
Reproducer
https://codesandbox.io/p/sandbox/primereact-bug-labeless-button-no-centered-icon-zjyc47
PrimeReact version
10.2.1
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Centered icon in labeless default button.
The text was updated successfully, but these errors were encountered: