From 3c1ffc080785b7c178fc8fb050c767fbef567662 Mon Sep 17 00:00:00 2001 From: Alican Erdurmaz Date: Fri, 31 May 2024 17:01:48 +0300 Subject: [PATCH] feat: add tailwind remix --- presets.js | 12 ++++++++ .../plugins/tailwindcss/tailwind.config.js | 13 --------- refine-remix/plugins/_base/extend.js | 28 +++++++++---------- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.forgot-password.tsx | 2 +- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_auth.register.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.forgot-password.tsx | 2 +- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_auth.register.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.forgot-password.tsx | 2 +- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_auth.register.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../app/routes/_auth.forgot-password.tsx | 2 +- .../app/routes/_auth.login.tsx | 2 +- .../app/routes/_auth.register.tsx | 2 +- .../app/routes/_layout.tsx | 4 +-- .../plugins/tailwindcss/app}/global.css | 0 .../plugins/tailwindcss/meta.json | 0 .../plugins/tailwindcss/package.json | 0 .../plugins/tailwindcss/postcss.config.js | 0 .../plugins/tailwindcss/tailwind.config.ts | 9 ++++++ refine-remix/prompt.js | 13 +++++++-- 31 files changed, 74 insertions(+), 59 deletions(-) delete mode 100644 refine-nextjs/plugins/tailwindcss/tailwind.config.js rename {refine-nextjs/plugins/tailwindcss/src/styles => refine-remix/plugins/tailwindcss/app}/global.css (100%) rename {refine-nextjs => refine-remix}/plugins/tailwindcss/meta.json (100%) rename {refine-nextjs => refine-remix}/plugins/tailwindcss/package.json (100%) rename {refine-nextjs => refine-remix}/plugins/tailwindcss/postcss.config.js (100%) create mode 100644 refine-remix/plugins/tailwindcss/tailwind.config.ts diff --git a/presets.js b/presets.js index 3421b613f..a7881de1c 100644 --- a/presets.js +++ b/presets.js @@ -124,5 +124,17 @@ module.exports = { "headless-example": "no", }, }, + { + name: "refine-remix-tailwind", + type: "refine-remix", + answers: { + "ui-framework": "tailwindcss", + "data-provider": "data-provider-custom-json-rest", + "auth-provider": "none", + "antd-example": "no", + "mui-example": "no", + "headless-example": "no", + }, + }, ], }; diff --git a/refine-nextjs/plugins/tailwindcss/tailwind.config.js b/refine-nextjs/plugins/tailwindcss/tailwind.config.js deleted file mode 100644 index b23c6cf2d..000000000 --- a/refine-nextjs/plugins/tailwindcss/tailwind.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - "./app/**/*.{js,ts,jsx,tsx,mdx}", - "./pages/**/*.{js,ts,jsx,tsx,mdx}", - "./components/**/*.{js,ts,jsx,tsx,mdx}", - "./src/**/*.{js,ts,jsx,tsx,mdx}", - ], - theme: { - extend: {}, - }, - plugins: [], -}; diff --git a/refine-remix/plugins/_base/extend.js b/refine-remix/plugins/_base/extend.js index c1f368026..1ec88ecc9 100644 --- a/refine-remix/plugins/_base/extend.js +++ b/refine-remix/plugins/_base/extend.js @@ -26,6 +26,8 @@ module.exports = { const dataProvider = answers["data-provider"]; const authProvider = answers["auth-provider"]; const uiFramework = answers["ui-framework"]; + const isHeadless = + uiFramework === "no" || uiFramework === "tailwindcss"; // ## isNextAuthCheck if ( @@ -66,7 +68,7 @@ module.exports = { ]; // update for headless - if (uiFramework === "no") { + if (isHeadless) { base._app.authPageProps = [ ` renderContent={(content) => ( @@ -116,16 +118,13 @@ module.exports = { base.selectedSvg = svgFromAnswers; } - if ( - answers["ui-framework"] !== "no" && - (answers["title"] || answers["svg"]) - ) { + if (!isHeadless && (answers["title"] || answers["svg"])) { base._app.localImport.push( 'import { AppIcon } from "@components/app-icon";', ); } - if (answers["ui-framework"] === "no") { + if (isHeadless) { base._app.localImport.push(`import styles from "~/global.css";`); base._app.styleImport.push('{ rel: "stylesheet", href: styles }'); } @@ -154,7 +153,7 @@ module.exports = { } else if (dataProvider === "data-provider-supabase") { base.blogPostCategoryIdFormField = `"categoryId"`; } else { - if (uiFramework === "mui" || uiFramework === "no") { + if (uiFramework === "mui" || isHeadless) { base.blogPostCategoryIdFormField = `"category.id"`; } else { base.blogPostCategoryIdFormField = `["category", "id"]`; @@ -163,7 +162,7 @@ module.exports = { // ## blogPostCategoryTableField if (base.isGraphQL) { - if (uiFramework === "no") { + if (isHeadless) { base.blogPostCategoryTableField = `"category.title"`; } if (uiFramework === "antd") { @@ -194,7 +193,7 @@ module.exports = { { value: "rejected", label: "Rejected" }, ]); } - if (uiFramework === "no" || uiFramework === "mui") { + if (isHeadless || uiFramework === "mui") { base.blogPostStatusOptions = JSON.parse(base.blogPostStatusOptions); } @@ -206,17 +205,16 @@ module.exports = { } // ## Refine options.title - if ( - answers["ui-framework"] !== "no" && - (answers["title"] || answers["svg"]) - ) { + if (!isHeadless && (answers["title"] || answers["svg"])) { if (!base._app.refineOptions) { base._app.refineOptions = []; } - const textLine = answers["title"] ? `text: "${answers["title"]}",` : ""; + const textLine = answers["title"] + ? `text: "${answers["title"]}",` + : ""; const iconLine = answers["svg"] ? `icon: ,` : ""; const template = `title: { ${textLine} ${iconLine} },`; - + base._app.refineOptions.push(template); } diff --git a/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.login.tsx b/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.login.tsx index 74e3d2653..1fd08fb5f 100644 --- a/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/auth-provider-auth0/app/routes/_auth.login.tsx @@ -101,7 +101,7 @@ export default function Login() { ); <%_ } _%> - <%_ if (answers["ui-framework"] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> return(
+<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> @@ -23,7 +23,7 @@ import { Layout } from "~/components/layout"; export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.forgot-password.tsx b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.forgot-password.tsx index 9fd0f3ac8..488681418 100644 --- a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.forgot-password.tsx +++ b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.forgot-password.tsx @@ -8,7 +8,7 @@ import { AuthPage, } from "@refinedev/mui"; <%_ } _%> -<%_ if (answers[`ui-framework`] === "no") { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.login.tsx b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.login.tsx index f479d7478..c189d77ad 100644 --- a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.login.tsx @@ -8,7 +8,7 @@ import { AuthPage, } from "@refinedev/mui"; <%_ } _%> -<%_ if (answers[`ui-framework`] === "no") { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.register.tsx b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.register.tsx index 2f5c44bdd..05b1325fb 100644 --- a/refine-remix/plugins/auth-provider-custom/app/routes/_auth.register.tsx +++ b/refine-remix/plugins/auth-provider-custom/app/routes/_auth.register.tsx @@ -8,7 +8,7 @@ import { AuthPage, } from "@refinedev/mui"; <%_ } _%> -<%_ if (answers[`ui-framework`] === "no") { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/auth-provider-custom/app/routes/_layout.tsx b/refine-remix/plugins/auth-provider-custom/app/routes/_layout.tsx index 1db3bb1a6..c26f00a94 100644 --- a/refine-remix/plugins/auth-provider-custom/app/routes/_layout.tsx +++ b/refine-remix/plugins/auth-provider-custom/app/routes/_layout.tsx @@ -15,14 +15,14 @@ import { import { Header } from "@components/header"; import { authProvider } from "~/authProvider"; -<%_ if (answers["ui-framework"] === 'no') { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/auth-provider-google/app/routes/_auth.login.tsx b/refine-remix/plugins/auth-provider-google/app/routes/_auth.login.tsx index a6212e737..0194ba4d4 100644 --- a/refine-remix/plugins/auth-provider-google/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/auth-provider-google/app/routes/_auth.login.tsx @@ -99,7 +99,7 @@ export default function Login() { ); <%_ } _%> - <%_ if (answers["ui-framework"] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> return(
+<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.login.tsx b/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.login.tsx index 2643582a4..3667fe8d9 100644 --- a/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/auth-provider-keycloak/app/routes/_auth.login.tsx @@ -101,7 +101,7 @@ export default function Login() { ); <%_ } _%> - <%_ if (answers["ui-framework"] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> return(
+<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.forgot-password.tsx b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.forgot-password.tsx index 1f2a8253c..5bba63ad7 100644 --- a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.forgot-password.tsx +++ b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.forgot-password.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.login.tsx b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.login.tsx index 419e3ab01..c3e642d5c 100644 --- a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.login.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.register.tsx b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.register.tsx index 6a9bca7d2..b8d4de56b 100644 --- a/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.register.tsx +++ b/refine-remix/plugins/data-provider-appwrite/app/routes/_auth.register.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-appwrite/app/routes/_layout.tsx b/refine-remix/plugins/data-provider-appwrite/app/routes/_layout.tsx index 5b75e01ce..45832efd0 100644 --- a/refine-remix/plugins/data-provider-appwrite/app/routes/_layout.tsx +++ b/refine-remix/plugins/data-provider-appwrite/app/routes/_layout.tsx @@ -15,14 +15,14 @@ import { import { Header } from "@components/header"; import { authProvider } from "~/authProvider"; -<%_ if (answers["ui-framework"] === 'no') { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.forgot-password.tsx b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.forgot-password.tsx index 67e6c36e2..444b0b0ed 100644 --- a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.forgot-password.tsx +++ b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.forgot-password.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.login.tsx b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.login.tsx index ce932db85..8676c0da5 100644 --- a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.login.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.register.tsx b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.register.tsx index 036a38aef..9e7554799 100644 --- a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.register.tsx +++ b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_auth.register.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_layout.tsx b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_layout.tsx index 5b75e01ce..45832efd0 100644 --- a/refine-remix/plugins/data-provider-strapi-v4/app/routes/_layout.tsx +++ b/refine-remix/plugins/data-provider-strapi-v4/app/routes/_layout.tsx @@ -15,14 +15,14 @@ import { import { Header } from "@components/header"; import { authProvider } from "~/authProvider"; -<%_ if (answers["ui-framework"] === 'no') { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.forgot-password.tsx b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.forgot-password.tsx index 67e6c36e2..444b0b0ed 100644 --- a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.forgot-password.tsx +++ b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.forgot-password.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.login.tsx b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.login.tsx index ce932db85..8676c0da5 100644 --- a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.login.tsx +++ b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.login.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.register.tsx b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.register.tsx index 036a38aef..9e7554799 100644 --- a/refine-remix/plugins/data-provider-supabase/app/routes/_auth.register.tsx +++ b/refine-remix/plugins/data-provider-supabase/app/routes/_auth.register.tsx @@ -4,7 +4,7 @@ <%_ if (answers["ui-framework"] === 'mui') { _%> import { AuthPage } from "@refinedev/mui"; <%_ } _%> - <%_ if (answers[`ui-framework`] === "no") { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { AuthPage } from "@refinedev/core"; <%_ } _%> diff --git a/refine-remix/plugins/data-provider-supabase/app/routes/_layout.tsx b/refine-remix/plugins/data-provider-supabase/app/routes/_layout.tsx index 5b75e01ce..45832efd0 100644 --- a/refine-remix/plugins/data-provider-supabase/app/routes/_layout.tsx +++ b/refine-remix/plugins/data-provider-supabase/app/routes/_layout.tsx @@ -15,14 +15,14 @@ import { import { Header } from "@components/header"; import { authProvider } from "~/authProvider"; -<%_ if (answers["ui-framework"] === 'no') { _%> +<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> import { Layout } from "~/components/layout"; <%_ } _%> export default function BaseLayout() { return ( <> - <%_ if (answers["ui-framework"] === 'no') { _%> + <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%> diff --git a/refine-nextjs/plugins/tailwindcss/src/styles/global.css b/refine-remix/plugins/tailwindcss/app/global.css similarity index 100% rename from refine-nextjs/plugins/tailwindcss/src/styles/global.css rename to refine-remix/plugins/tailwindcss/app/global.css diff --git a/refine-nextjs/plugins/tailwindcss/meta.json b/refine-remix/plugins/tailwindcss/meta.json similarity index 100% rename from refine-nextjs/plugins/tailwindcss/meta.json rename to refine-remix/plugins/tailwindcss/meta.json diff --git a/refine-nextjs/plugins/tailwindcss/package.json b/refine-remix/plugins/tailwindcss/package.json similarity index 100% rename from refine-nextjs/plugins/tailwindcss/package.json rename to refine-remix/plugins/tailwindcss/package.json diff --git a/refine-nextjs/plugins/tailwindcss/postcss.config.js b/refine-remix/plugins/tailwindcss/postcss.config.js similarity index 100% rename from refine-nextjs/plugins/tailwindcss/postcss.config.js rename to refine-remix/plugins/tailwindcss/postcss.config.js diff --git a/refine-remix/plugins/tailwindcss/tailwind.config.ts b/refine-remix/plugins/tailwindcss/tailwind.config.ts new file mode 100644 index 000000000..7e493683e --- /dev/null +++ b/refine-remix/plugins/tailwindcss/tailwind.config.ts @@ -0,0 +1,9 @@ +import type { Config } from "tailwindcss"; + +export default { + content: ["./app/**/*.{js,jsx,ts,tsx}"], + theme: { + extend: {}, + }, + plugins: [], +} satisfies Config; diff --git a/refine-remix/prompt.js b/refine-remix/prompt.js index 64b720fe1..371097605 100644 --- a/refine-remix/prompt.js +++ b/refine-remix/prompt.js @@ -75,6 +75,11 @@ module.exports = { name: "mui", hint: "Installs Material UI package.", }, + { + message: "Tailwind CSS", + name: "tailwindcss", + hint: "Installs Tailwind CSS package.", + }, ], default: "no", }, @@ -194,7 +199,8 @@ module.exports = { when: function (answers) { return ( typeof answers["svg"] === "undefined" || - answers["ui-framework"] === "no" + answers["ui-framework"] === "no" || + answers["ui-framework"] === "tailwindcss" ); }, pattern: ["app/components/app-icon/index.tsx"], @@ -202,7 +208,10 @@ module.exports = { { plugin: ["_base"], when: function (answers) { - return answers["ui-framework"] !== "no"; + return ( + answers["ui-framework"] !== "no" && + answers["ui-framework"] !== "tailwindcss" + ); }, pattern: [ "app/components/breadcrumb/index.tsx",