Skip to content

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 <peter@neupauer.sk>
@adamwathan
Copy link
Member

Looks good, thank you!

@adamwathan adamwathan merged commit 0b5f5e9 into tailwindlabs:master Apr 4, 2021
adamwathan pushed a commit that referenced this pull request May 7, 2021
Signed-off-by: Peter Neupauer <peter@neupauer.sk>
@neupauer neupauer deleted the patch-1 branch November 29, 2021 17:55
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.

2 participants