석이의 개발일지

empty 본문

CSS/Tailwind

empty

믹석이 2023. 2. 27. 17:30
728x90

:empty

  • empty modifier를 사용하여 콘텐츠가 없는 경우 스타일을 지정한다.
    콘텐츠가 없는 경우 => 빈 텍스트, undefined, null등과 같이 값이 없는 경우에 해당한다.
    empty:hidden은 display: none과 같다.
{[1, 2, ""].map((number) => (
	< h3 className="bg-red-500 empty:hidden" key={number}>
		{number}
	< /h3>
))}

https://tailwindcss.com/docs/hover-focus-and-other-states#empty

 

Handling Hover, Focus, and Other States - Tailwind CSS

Using utilities to style elements on hover, focus, and more.

tailwindcss.com

 

LIST

'CSS > Tailwind' 카테고리의 다른 글

Ring  (2) 2023.02.27
Tailwind CSS (계속 추가중)  (0) 2023.02.25
Comments