Closed prakash03yes closed 6 months ago
You are likely missing configuration for Tailwind merge which is required when adding customizing certain options in your Tailwind config file (e.g. text-
).
You can read about configuring tailwind merge in the docs:
Yeah I saw the documention and changed my tailwind-merge config file. thanks.
import { defaultConfig } from 'tailwind-variants';
import { COLORS } from './src/constants/colors.const';
import { FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from "./src/constants/font.const";
defaultConfig.twMergeConfig = {
classGroups: {
'font-size': [{ text: Object.keys(FONT_SIZE) }],
'font-weight': [{ font: Object.keys(FONT_WEIGHT) }],
'font-family': [{ font: Object.keys(FONT_FAMILY) }],
'text-color': [{ text: Object.keys(COLORS) }],
},
};
this is how my objects look ( for whoom doesn't understand whats going )
export const FONT_SIZE = { "10": "0.625rem", "12": "0.75rem", "14": "0.875rem", "16": "1rem", "18": "1.125rem", "20": "1.25rem", "24": "1.5rem", "32": "2rem", "40": "2.5rem", "50": "3.125rem", };
export const FONT_WEIGHT = { "100": "100", "200": "200", "300": "300", "400": "400", "500": "500", "600": "600", "700": "700", "800": "800", "900": "900" };
export const FONT_FAMILY = { "raleway": ["'Raleway Variable'", 'sans-serif'], "roboto": ["'Roboto'", "sans-serif"] }
As you can see in the screenshot there is no "text-secondaryOrange" it overrides with "text-32" which is unconvintional