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

feat(typography): allow listitem to inherit variant from parent list #7124

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

damienrobson-sage
Copy link
Contributor

@damienrobson-sage damienrobson-sage commented Dec 11, 2024

In order to reduce replication of code, ListItem now receives information on the variant of the parent List item via context; setting variant on List will pass it to child ListItem components.

Resolves #5413

Proposed behaviour

ListItem now inherits variant directly from it's parent List component

Current behaviour

Customers have to manually define the variant on each ListItem

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Unit tests added or updated if required
  • Storybook added or updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Testing instructions

Use Storybook to view the new approach/component structure. Additionally, verify that a deprecation warning is thrown if variant is added to any ListItem

Copy link
Contributor

@nuria1110 nuria1110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, my only comment would be that I don't believe this is a breaking change just yet if we are only adding a deprecation warning to ListItem and the prop is still available.

In order to reduce replication of code, ListItem now receives information on the variant of the
parent List item via context; setting variant on List will pass it to child ListItem components.

Resolves #5413
@damienrobson-sage damienrobson-sage force-pushed the FE-5336-listitem-font-style branch from da0aa5e to ad4f4e7 Compare December 16, 2024 10:37
@damienrobson-sage damienrobson-sage marked this pull request as ready for review December 16, 2024 11:02
@damienrobson-sage damienrobson-sage requested a review from a team as a code owner December 16, 2024 11:02
@damienrobson-sage damienrobson-sage merged commit 0784fab into master Dec 16, 2024
24 checks passed
@damienrobson-sage damienrobson-sage deleted the FE-5336-listitem-font-style branch December 16, 2024 14:40
@carbonci
Copy link
Collaborator

🎉 This PR is included in version 144.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

ListItem to inherit font styles from List
5 participants