Tailwind-Styled-Component icon indicating copy to clipboard operation
Tailwind-Styled-Component copied to clipboard

Apply tag selector that depends on another component

Open matheusTA opened this issue 2 years ago • 2 comments

matheusTA avatar Jun 25 '23 02:06 matheusTA

Hi,

I need an equivalent of this:

export const Header = styled.div`
	background-color: #000;
	display: flex;
	justify-content: space-between;
	align-items: center;

	span {
		color: #fff;
	}

	button {
		background-color: #67f;
		color: #000;
	}
`;

Is there an equivalent with this library?

matheusTA avatar Jun 25 '23 02:06 matheusTA

me too for next.js 13 app directory

soheilghanbary avatar Sep 16 '23 11:09 soheilghanbary

You can probably use tailwind's primitive nested selectors like [&_span]:text-white [&_button]:bg-[#67f] [&_button]:bg-black right? So that'd be independent from this library.

Kadrian avatar Apr 15 '24 14:04 Kadrian