How can I install @tailwindcss/typography to latest Phoenix?

I think I may be mixing things, but how do I install Tailwind plugins? Is it just a matter of adding the require statement to tailwind.config.js? Do I still need to use npm to first install the plugin?

Add it to the config and it should be bundled on restart phx.server

2 Likes

The used tailwind cli comes with all official plugins, which you can just add to the config. For third party plugins you‘d need to figure out how to install the plugin as well as tailwind itself, because the cli afaik cannot integrate with those third party plugins for being a precompiled binary.

2 Likes

Has anyone successfully added typography plugin to TailwindCSS v4 which doesn’t use tailwind config file?

EDIT: Whoops, never mind

@MatijaL this is still true

See tailwindcss/packages/@tailwindcss-standalone/package.json at 3e53e2566990607c928c2306447e6bf5e199e78e · tailwindlabs/tailwindcss · GitHub

That means, that if you’re using the standalone CLI you can just @plugin @tailwindcss/typography; in your CSS file where you do your @import 'tailwindcss';. If you’re using the NPM installed version you have to add it as a package dependecy and then import it in the same way

1 Like