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

[Bug]: Tabs content should have $layer-01 background #14443

Closed
2 tasks done
shixiedesign opened this issue Aug 16, 2023 · 6 comments
Closed
2 tasks done

[Bug]: Tabs content should have $layer-01 background #14443

shixiedesign opened this issue Aug 16, 2023 · 6 comments

Comments

@shixiedesign
Copy link
Contributor

Package

@carbon/styles

Browser

No response

Package version

1.35.0

React version

No response

Description

I noticed tabs being used with tab content having no background, which makes the $layer-01 background of selected tab not really work as selected when there are 2 tabs. I believe the original design intent is the selected tab's content has $layer-01 background so it matches that of the tab above it, creating a visual connection:

image

Reproduction/example

https://react.carbondesignsystem.com/?path=/story/components-tabs--contained

Steps to reproduce

Go to https://react.carbondesignsystem.com/?path=/story/components-tabs--contained

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

Carbon for Salesforce

Code of Conduct

@tay1orjones
Copy link
Member

@carbon-design-system/design could you confirm? It looks like this is just contained tabs.

There is no background style applied to .cds--tab-content, so this doesn't respond to being wrapped in a Layer component.

@kingtraceyj
Copy link
Member

HI @shixiedesign! we originally didn't include a back in the design specs. can you explain a little more why the layers aren't working? thank you!

@sstrubberg sstrubberg closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
@github-project-automation github-project-automation bot moved this to ✅ Done in Design System Nov 8, 2023
@shixiedesign
Copy link
Contributor Author

shixiedesign commented Nov 9, 2023

Sorry I don't seem to be getting email notification on the pings here except when issue closes.

So @kingtraceyj the layers aren't working because of what @tay1orjones said, I suppose:

There is no background style applied to .cds--tab-content, so this doesn't respond to being wrapped in a Layer component.

There's .cds-tabs-content div as part of the Tabs component. This is good because users are expected to put content inside it. But because there's no background, contained tabs will always take the background of the Page, not the background of the selected tab which is a layer. So it's like an extra step (custom override) needed to use an out-of-the-box component correctly, and from my observation it's a common mistake to put contained tabs on non-matching background like left image in description. My understanding is that the contained tabs's content should always be on background matching the selected tabs. Is that right? If so, I think ideally we add that background to Contained tabs.

@sstrubberg sstrubberg reopened this Nov 9, 2023
@github-project-automation github-project-automation bot moved this from ✅ Done to ⏱ Backlog in Design System Nov 9, 2023
@laurenmrice laurenmrice moved this from ⏱ Backlog to 🪆 Needs Refined in Design System Dec 13, 2023
@tay1orjones
Copy link
Member

from my observation it's a common mistake to put contained tabs on non-matching background

It's hard to know how pervasive this is. If we add the background, I think adding it behind a feature flag would be needed so that users don't pull a new minor and see visual changes in their app that they didn't have before. We can make it the default behavior in the next major.

@tay1orjones tay1orjones added the version: 12 Issues pertaining to a future major release of Carbon label Jan 10, 2024
@kingtraceyj
Copy link
Member

kingtraceyj commented Apr 4, 2024

@tay1orjones was the recently merged PR under the v12 feature flag? it looks live in v11.

Updates:

#15787

#15791

@kingtraceyj
Copy link
Member

Updated documentation to reflect tab panel layering model

Tab panel is updated in storybook

@github-project-automation github-project-automation bot moved this from 🪆 Needs Refined to ✅ Done in Design System Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants