Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

last child of last child tailwind

/* https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state
*/
/* Using 'group' in tailwind to achieve this */

<main class='flex flex-col space-y-2'>
	<div class='group'>
		<div>...</div>
		<div>...</div>
		<div class='group-last:last:bg-amber-400'>...</div>
	</div>

	<div class='group'>
		<div>...</div>
		<div>...</div>
		<div class='group-last:last:bg-amber-400'>...</div> /* this one */
	</div>
</main>
 
PREVIOUS NEXT
Tagged: #child #child #tailwind
ADD COMMENT
Topic
Name
9+1 =