Replies: 2 comments
-
What have you tried? The only caveat is that you have to
// .prettierrc.cjs
module.exports = {
plugins: [require.resolve("prettier-plugin-tailwindcss")],
};
// main.jsx
function MyButton({ children }) {
return (
<button className="bg-blue-500 rounded px-4 py-2 text-base text-white">
{children}
</button>
);
}
If you are using the VSCode extension:
Assuming you have configured prettier as your formatter you have Format(-on-save) now |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have tried a lot of things that were close to this, but not exactly this solution, and this does in fact work. Thanks, Clement! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been trying to configure prettier-plugin-tailwindcss to work with zero installs and am not having any success... I'd like to follow the recommended class order, and it's easy if the plugin does it for you working with prettier to format on save; or, with lint-staged and husky on commit. Though I am having no luck. Anyone else find a solution to this or is this something that will need SDK support in the
.yarn/sdks
folder?Beta Was this translation helpful? Give feedback.
All reactions