mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* Tailwind variants support (hover, focus, placeholder, etc. cases are transformed now) * Settings page let user define custom Tailwind configs, and "Tailwind preprocessor input" * Default tailwind.css built with SSG * Many fixes for corner cases
17 lines
496 B
TypeScript
17 lines
496 B
TypeScript
import postcss from "postcss";
|
|
import tailwindcss from "tailwindcss";
|
|
import defaultConfig from "tailwindcss/stubs/simpleConfig.stub.js";
|
|
import autoprefixer from "autoprefixer";
|
|
|
|
export default async function buildTailwindCss(
|
|
tailwindConfig: any,
|
|
postCssInput: string
|
|
): Promise<string> {
|
|
const { css } = await postcss([
|
|
tailwindConfig ? tailwindcss(tailwindConfig) : tailwindcss(defaultConfig),
|
|
autoprefixer
|
|
]).process(postCssInput, { from: "tailwind.css" });
|
|
|
|
return css;
|
|
}
|