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

Add .list-item display utility #3929

Merged
merged 1 commit into from
Apr 4, 2021
Merged

Conversation

neupauer
Copy link
Contributor

@neupauer neupauer commented Apr 4, 2021

This PR adds .list-item display utility.

It is the default value for the list item.

Adding a display: list-item to the element is useful in situations where you conditionally show/hide an item in the list, or toggling between flex and default behavior.

Also useful when creating fake lists.

E.g.: (This is just an example, I know it can be done like predicate ? '' : 'hidden')

<ul>
  <li>A</li>
  <li className={predicate ? 'list-item' : 'hidden'}>B</li>
  <li>C</li>
</ul>
<div>
  <div class="list-item">A</div>
  <div class="list-item">B</div>
</div>

Links:
MDN: display-listitem

Signed-off-by: Peter Neupauer <[email protected]>
@adamwathan
Copy link
Member

Looks good, thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants