In one of my react component, I receive a color palette, and want to use a variation. Basically, here is what I done to have a color variation:
import { Link } from 'react-router-dom';
export interface LinkModel {
to: string;
label: string;
color?: string;
}
export const Alink = ({ to, label, color = 'primary' }: LinkModel) => {
return (
<div>
<Link to={to} className={'font-medium text-' + color + '-600 hover:text-' + color + '-500'}>
{label}
</Link>
</div>
);
};
I noticed that IF a combination(like text-primary-600) isn't present anywhere in the app, it just doesnt get bundled the styles and my link isn't colored.
How to force some styles to be bundled?