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

ListItem to inherit font styles from List #5413

Closed
1 task done
johnb-sage opened this issue Aug 24, 2022 · 3 comments · Fixed by #7124
Closed
1 task done

ListItem to inherit font styles from List #5413

johnb-sage opened this issue Aug 24, 2022 · 3 comments · Fixed by #7124

Comments

@johnb-sage
Copy link

Desired behaviour

ListItem inherits font styles from List. To apply a font variant to all list items, the variant prop may be set on List alone.

<List variant="big">
	<ListItem>item 1</ListItem>
	<ListItem>item 2</ListItem>
	<ListItem>item 3</ListItem>
</List>

Current behaviour

Currently, ListItem does not inherit font styles from List. To apply a font variant to all list items, each list item must have the variant set.

<List>
	<ListItem variant="big">item 1</ListItem>
	<ListItem variant="big">item 2</ListItem>
	<ListItem variant="big">item 3</ListItem>
</List>

Suggested Solution

No response

CodeSandbox or Storybook URL

https://codesandbox.io/s/list-9tee68

Anything else we should know?

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@johnb-sage johnb-sage added Enhancement triage Triage Required labels Aug 24, 2022
@Parsium
Copy link
Contributor

Parsium commented Aug 30, 2022

FE-5336

@Parsium Parsium added On Backlog and removed triage Triage Required labels Aug 30, 2022
@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. If you believe this issue is still valid and required please comment below. It will be reviewed by the core Carbon team and may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2023
damienrobson-sage added a commit that referenced this issue 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.

BREAKING CHANGE: `ListItem` will no longer accept the `variant` prop directly; it must now be set on
the parent `List`.

Resolves #5413
damienrobson-sage added a commit that referenced this issue Dec 13, 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.

BREAKING CHANGE: `ListItem` will no longer accept the `variant` prop directly; it must now be set on
the parent `List`.

Resolves #5413
damienrobson-sage added a commit that referenced this issue Dec 16, 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
carbonci pushed a commit that referenced this issue Dec 16, 2024
## [144.22.0](v144.21.1...v144.22.0) (2024-12-16)

### Features

* **typography:** allow listitem to inherit variant from parent list ([ad4f4e7](ad4f4e7)), closes [#5413](#5413)
@carbonci
Copy link
Collaborator

🎉 This issue has been resolved 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 a pull request may close this issue.

3 participants