With angular 19 and tailwind 4.1, I simply add @source in my main style.scss, and all tailwind CSS classes used by my lib are correctly exported
@use "tailwindcss";
@source "../node_modules/my-lib";
From documentation : https://tailwindcss.com/docs/functions-and-directives#source-directive
Use the
@source
directive to explicitly specify source files that aren't picked up by Tailwind's automatic content detection: