-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
card-header and card-footer need radius overrides when bg-color-X set #2562
Comments
@niktek I think this would be easier to understand with a screenshot. That said, rounded styles now extend Tailwind's default border radius styles in v3. So this issue would be limited to v2. Header/Footer styles are also gone in v3. |
@niktek sorry for the delay on this one. Now that I've had a chance to read through this with a clear mind I see what you mean. The goal with the v2 implementation was to keep a unified spacing around the edge of the screen, as well as between sections. For example, all yellow lines shown should have uniform spacing: Unfortunately, if you double up the spacing by adding padding within the children, this will lead to a poor result where space appears doubled (or tripled) between the children. This can result in styles that feel very uneven: That said, if I was to try and handle this sort of layout today, what I'd instead opt for is custom styles like this. This approach should work in Skeleton v2 or v3: <!-- Surrounding Gap -->
<div class="card p-4 space-y-4">
<header class="bg-primary-500">Header</header>
<section>Content</section>
<footer class="bg-primary-500">Footer</footer>
</div>
<!-- Flush -->
<div class="card">
<header class="p-4 bg-primary-500">Header</header>
<section class="p-4">Content</section>
<footer class="p-4 bg-primary-500">Footer</footer>
</div> Given the header/footer concepts won't be carrying forward to Skeleton v3, I'd recommend following the pattern above for now. I don't think there's a sane way we can handle every use case folks might in v2, so we'll call this a wash. |
Current Behavior
When setting a bg color on a
card-header
orcard-footer
it will overpaint the containingcard
and its border-radius setting. I think if the user is opting into a card then it should carry through the expected border-radius to the child elements. The following uses tokens to re-apply the border radius on the card-header, but removing them will make it appear like card-footer.It also raises a question of whether we should also extend the rounded tokens to match the options TW provides as we are missing tokens for (would we still keep container in there?):
Expected Behavior
No response
Steps To Reproduce
No response
Link to Reproduction / Stackblitz
No response
More Information
No response
The text was updated successfully, but these errors were encountered: