tss - the Modern API
useStyles
import { useStyles } from "tss-react" // or "tss-react/mui";
function MyComponent(){
const {
css, //<- Like the css function of @emotion/css
cx //<- Like the cx function of @emotion/css, also known as clsx. It's smarter though, classes that comes last take priority.
} = useStyles();
return (
<div className={cx(css({ backgroundColor: "black" }), "myClassName")}>
<span className={css({ color: "red" })}>
Hello World
</span>
</div>
);
}tss.create(...)
tss.withParams()
tss.withName(name)
tss.withNestedSelectors<"a" | "b" | "c">()
createTss()
Last updated
Was this helpful?
