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

fix(select.tsx/badge.tsx): With icon classes preference #877

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

nigellima
Copy link
Collaborator

Summarize the changes made and the motivation behind them.
twMerge is removing the padding classes for the Select.tsx component when an icon is passed.

I also checked if the issue was happening in other components too and I noticed tha the Badge.tsx component had the same problem. Even though it was not breaking visually when a Badge had an icon, if the user passes a p- class to the custom theme object it was not being applied due to the preference ordering in twMerge

Reference related issues using # followed by the issue number.
Fix #869

the ordering of the classNames in the twMerge was removing important classes when Select hadan Icon

fix themesberg#869
the ordering of the classNames in the twMerge was preventing yo customize padding attributes of the
badge when it had an icon
@vercel
Copy link

vercel bot commented Jul 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2023 2:49pm

@nigellima nigellima changed the title fix(select.tsx/badge.tsx): With icon classes preferene fix(select.tsx/badge.tsx): With icon classes preference Jul 23, 2023
@codecov
Copy link

codecov bot commented Jul 23, 2023

Codecov Report

Patch coverage: 99.82% and project coverage change: -0.02 ⚠️

Comparison is base (7461173) 99.54% compared to head (a8d3f28) 99.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #877      +/-   ##
==========================================
- Coverage   99.54%   99.53%   -0.02%     
==========================================
  Files         163      166       +3     
  Lines        6621     6879     +258     
  Branches      401      418      +17     
==========================================
+ Hits         6591     6847     +256     
- Misses         30       32       +2     
Impacted Files Coverage Δ
src/components/Toast/theme.ts 100.00% <ø> (ø)
src/components/Dropdown/Dropdown.tsx 99.22% <99.41%> (-0.78%) ⬇️
src/components/Badge/Badge.tsx 100.00% <100.00%> (ø)
src/components/Button/Button.tsx 100.00% <100.00%> (ø)
src/components/Button/ButtonBase.tsx 100.00% <100.00%> (ø)
src/components/Button/theme.ts 100.00% <100.00%> (ø)
src/components/Card/Card.tsx 100.00% <100.00%> (ø)
src/components/Carousel/Carousel.tsx 99.02% <100.00%> (+0.06%) ⬆️
src/components/DarkThemeToggle/DarkThemeToggle.tsx 100.00% <100.00%> (ø)
src/components/Dropdown/DropdownItem.tsx 100.00% <100.00%> (ø)
... and 17 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rluders rluders merged commit ebe605e into themesberg:main Jul 25, 2023
@nigellima nigellima deleted the fix/select-badge-classname-ordering branch July 25, 2023 18:35
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

Successfully merging this pull request may close these issues.

Select is not rendering the icon prop with the correct padding
2 participants