diff --git a/presets.js b/presets.js
index 3421b613..a7881de1 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 b23c6cf2..00000000
--- 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 c1f36802..1ec88ecc 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 74e3d265..1fd08fb5 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 9fd0f3ac..48868141 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 f479d747..c189d77a 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 2f5c44bd..05b1325f 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 1db3bb1a..c26f00a9 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 a6212e73..0194ba4d 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 2643582a..3667fe8d 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 1f2a8253..5bba63ad 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 419e3ab0..c3e642d5 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 6a9bca7d..b8d4de56 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 5b75e01c..45832efd 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 67e6c36e..444b0b0e 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 ce932db8..8676c0da 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 036a38ae..9e755479 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 5b75e01c..45832efd 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 67e6c36e..444b0b0e 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 ce932db8..8676c0da 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 036a38ae..9e755479 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 5b75e01c..45832efd 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 00000000..7e493683
--- /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 64b720fe..37109760 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",