Skip to content

Instantly share code, notes, and snippets.

@HugeLetters
Created September 12, 2023 09:47
Show Gist options
  • Save HugeLetters/3e19c0fa6ec45380175436a255b73c80 to your computer and use it in GitHub Desktop.
Save HugeLetters/3e19c0fa6ec45380175436a255b73c80 to your computer and use it in GitHub Desktop.
How to compose CSS in web frameworks
function Page() {
return (
<div className="flex">
<div>Page</div>
<Component />
</div>
);
}
function Component() {
return <div className="items-center">component</div>;
}
function Page() {
return (
<div className="flex">
<div>Page</div>
<Component className="items-center" />
</div>
);
}
function Component({ className }: { className: string }) {
return <div className={className}>component</div>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment