-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config from tailwind.config.js #4
Comments
I think that would solve the problem with unknown types in classes. I use numerical values for font sizes in my projects, for example, "text-20 text-primary" => "text-primary" |
@DawidMazur Thanks for your question. This is already on my todo list. |
@DawidMazur Could you provide your tailwind.config.js or at least the relevant parts? |
|
Same issue here, Im using with tailpress, so I have a font size config like this: theme.extend.fontSize: [
"subtitle": [
"1rem",
{
"lineHeight": "129%",
"fontWeight": "600"
}
]
] My results: "text-white text-subtitle" = "text-subtitle"
OR
"text-subtitle text-white" = " text-white" |
Hi @KawanSoares You could already achieve this by manually configure TwMerge. TailwindMerge::factory()->withConfiguration([
'classGroups' => [
'font-size' => [
['text' => ['subtitle']]
],
],
])->make() Auto configure from tailwind.config.js is not required for that, but would be a nice improvement. Additionally I need to add the documentation for the configuration. |
Hi guys, me again 👍 Thanks for reply @gehrisandro, that was just one example, I have many more font sizes 😆, so I did use of this $tw = TailwindMerge::factory()->withConfiguration([
'classGroups' => [
'font-size' => [
['text' => array_keys((array)$tailwindConfig->theme->fontSize)]
],
'text-color' => [
['text' => array_keys((array)$tailwindConfig->theme->colors)]
],
],
])->make(); It worked! 😆 |
Hi @KawanSoares Thank you very much for your reply. I have definitively to check this one. Maybe it will help us to automate this more easily. |
Hi,
Is it possible to add an option to import Tailwind configuration from a JavaScript configuration file?
The text was updated successfully, but these errors were encountered: