/** * The Tailwind 3 PostCSS plugin name for an app that imports c15t from * `importPath`. The plugin comes from the package the app installed, so * PostCSS can resolve it without `@c15t/ui` as a direct dependency. * * @param importPath - The c15t entry point the app imports, such as * `c15t/next` or `@c15t/react` * @returns The plugin name, such as `c15t/postcss-tailwind3` */ export declare const tailwind3PostcssPluginName: (importPath: string) => string; export type EnsureTailwind3PostcssPluginResult = { status: 'present' | 'added'; filePath: string; } | { status: 'manual' | 'config-ignored'; filePath: string | null; }; /** * Whether a `tailwindcss` dependency range targets Tailwind 3. * * @param version - The range from package.json, or null without Tailwind * @returns True for nonempty ranges restricted to Tailwind 3 */ export declare const isTailwindV3: (version: string | null) => boolean; type PostcssConfigEdit = { status: 'present'; } | { status: 'added'; content: string; } | { status: 'manual'; }; /** * Add the c15t plugin in front of `tailwindcss` in a PostCSS config. * * @param content - The config file's source * @param fileName - The config's file name, which selects JSON, JavaScript * or TypeScript parsing * @param pluginName - The plugin name to add, from * {@link tailwind3PostcssPluginName} * @returns `present` when the active plugin list already loads a c15t * package's plugin (any `…/postcss-tailwind3`) before `tailwindcss`, * `added` with the updated source, or `manual` when the config has no * single plugin list with a `tailwindcss` entry this can edit */ export declare const addTailwind3PluginToPostcssConfig: (content: string, fileName: string, pluginName: string) => PostcssConfigEdit; /** * Make sure a Tailwind 3 app runs c15t's `postcss-tailwind3` plugin before * `tailwindcss`. Tailwind 3 rejects c15t's `@layer components` blocks and * purges their rules; the plugin flattens them first. * * @param options.projectRoot - App root to search for a PostCSS config * @param options.pluginName - The plugin name to add, from * {@link tailwind3PostcssPluginName} * @param options.dryRun - Report the change without writing it * @returns `present` or `added` with the config path; `config-ignored` * for Create React App, which never reads a PostCSS config; or `manual` * when no config was found, package.json holds the config, several config * files exist, or the plugin list could not be edited */ export declare const ensureTailwind3PostcssPlugin: (options: { projectRoot: string; pluginName: string; dryRun?: boolean; }) => Promise; /** * The manual step for configs this module cannot edit. * * @param pluginName - The plugin name, from {@link tailwind3PostcssPluginName} * @returns The instruction to show */ export declare const tailwind3PostcssInstruction: (pluginName: string) => string; /** * Why Create React App cannot run Tailwind 3 with c15t, and the ways out. * react-scripts builds CSS with `postcss: { config: false }`. * * @param pluginName - The plugin name, from {@link tailwind3PostcssPluginName} * @returns The warning to show */ export declare const tailwind3CreateReactAppWarning: (pluginName: string) => string; export {};