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

ListBox cannot override padding #1254

Closed
coryvirok opened this issue Apr 1, 2023 · 3 comments · Fixed by #1267
Closed

ListBox cannot override padding #1254

coryvirok opened this issue Apr 1, 2023 · 3 comments · Fixed by #1267
Labels
bug Something isn't working

Comments

@coryvirok
Copy link

Current Behavior

The docs say that you can provide ListBox and ListBoxItem with custom padding. However, the built-in padding, px-4 py-2 is always included first. Which means the only way to override is to use a !px-2 !py-2 for e.g.

Steps To Reproduce

Create a new ListBox with custom padding:

<ListBox multiple padding="px-2 py-2">
  ...
</ListBox>

You'll notice that the rendered HTML contains both built in and "overridden" values:

e.g.
<label class="listbox-item px-4 py-2 cursor-pointer rounded-token px-2 py-2 hover:variant-soft " ...

Anything else?

No response

@coryvirok coryvirok added the bug Something isn't working label Apr 1, 2023
@Zantonius
Copy link
Contributor

The same is true for regionCell when it comes to Table 🙂

Steps To Reproduce

<Table regionCell="px-2" />

"px-2" will be overwritten by the default style.

If we want this to be separated to its' own issue, please do tell.

@endigo9740
Copy link
Contributor

@coryvirok There's a bit of and overlap for setting the Listbox parent padding and the padding padding down to the child. We do need to give this another review.

@Zantonius not quite the same. With regionCell you can use Tailwind's arbitrary syntax to access child elements:
https://www.skeleton.dev/docs/styling#tailwinds-arbitrary-variants

@endigo9740
Copy link
Contributor

@coryvirok ok this one ended up being a very simple fix. Essentially we have base classes we apply to each element within the component template, then we append the prop classes immediately following. Looks like we forgot to nix the base padding for this so both the base + prop padding were being added.

I've removed this the base padding in favor of the prop now, so this should now behave as expected.

The fix is merged into our dev branch which will drop as part of our new release on Tuesday of next week. Thanks for bringing this to our attention!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants