cva
Helper to write styles for an element.
To write our styles for a component we use cva. This library comes with a great utility function which we use to write styles for our components.
If you want to style your own component you can use this function which we updated with some additional style checks, for example it resolves conflicts in class names with tailwind-merge
. With this the class names will be merged together.
Import
import { cva } from '@marigold/system';
Examples
Style an element
This example shows how to use the function inside a div
element. You can add some variants and sizes if you want.
Preview
Code
this is some text