creativetimofficial / material-tailwind

@material-tailwind is an easy-to-use components library for Tailwind CSS and Material Design.
https://material-tailwind.com/
MIT License
3.51k stars 306 forks source link

Please support classNamePrefix #659

Open lyluongvan90 opened 3 months ago

lyluongvan90 commented 3 months ago

Curent situation: Suppose I write an input component: <Input variant="static" type="text" /> And here following is the html code it generated: <input class="peer w-full h-full bg-transparent text-blue-gray-700 font-sans font-normal outline outline-0 focus:outline-0 disabled:bg-blue-gray-50 disabled:border-0 disabled:cursor-not-allowed transition-all border-b placeholder-shown:border-blue-gray-200 text-sm pt-4 pb-1.5 border-blue-gray-200 focus:border-gray-900" type="text" />

Problem: In my project, I set up prefix "tw-" for all tailwindcss. So the above generated html doesnot work. It should be the following as my expected: <input class="tw-peer tw-w-full tw-h-full tw-bg-transparent tw-text-blue-gray-700 tw-font-sans tw-font-normal tw-outline tw-outline-0 tw-focus:outline-0 tw-disabled:bg-blue-gray-50 tw-disabled:border-0 tw-disabled:cursor-not-allowed tw-transition-all tw-border-b tw-placeholder-shown:border-blue-gray-200 tw-text-sm tw-pt-4 tw-pb-1.5 tw-border-blue-gray-200 tw-focus:border-gray-900" type="text" />

Expected: To resolve the problem, please make as the following:

module.exports = withMT({ prefix: "tw-", });


- Support props "classNamePrefix" for all component. For example
`<Input variant="static" type="text" classNamePrefix="tw-" />`