+<%_ 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 a8310bfc7..e7b3f99ae 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 a8310bfc7..e7b3f99ae 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 a8310bfc7..e7b3f99ae 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-remix/plugins/tailwindcss/app/global.css b/refine-remix/plugins/tailwindcss/app/global.css
new file mode 100644
index 000000000..d99ff9c0c
--- /dev/null
+++ b/refine-remix/plugins/tailwindcss/app/global.css
@@ -0,0 +1,104 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
+/*
+* These styles were added to improve the appearance of the example pages.
+* It is safe to delete them, and they are not intended to be used by Refine components.
+*/
+@layer base {
+ input {
+ @apply border border-gray-300 rounded-sm;
+ }
+
+ input[type="submit"] {
+ @apply bg-[#EFEFEF];
+ }
+
+ button {
+ @apply border border-gray-300 px-2 rounded-sm bg-[#EFEFEF];
+ }
+
+ h1 {
+ @apply text-2xl font-bold my-6;
+ }
+
+ ul {
+ @apply list-disc my-4;
+ }
+
+ a {
+ @apply text-blue-700 underline;
+ }
+
+ label {
+ @apply text-sm font-medium;
+ }
+
+ body {
+ @apply m-0 bg-white;
+ }
+
+ table {
+ @apply border border-black border-collapse;
+ }
+
+ table th,
+ table td {
+ @apply m-0 p-2 border-b border-r border-black;
+ }
+
+ table tr:last-child td {
+ @apply border-b-0;
+ }
+
+ table th:last-child,
+ table td:last-child {
+ @apply border-r-0;
+ }
+
+ .layout {
+ @apply flex gap-4;
+ }
+
+ @media (max-width: 751px) {
+ .layout {
+ @apply block;
+ }
+ }
+
+ .layout .content {
+ @apply flex flex-col flex-grow;
+ }
+
+ .breadcrumb {
+ @apply flex gap-6 p-2 px-4 border-b border-gray-300;
+ list-style-type: "/ ";
+ }
+
+ .breadcrumb a {
+ @apply text-blue-700 no-underline;
+ }
+
+ .menu {
+ @apply flex-shrink-0 p-2 pr-4 border-r border-gray-300;
+ }
+
+ .menu a {
+ @apply text-black;
+ }
+
+ .menu .active {
+ @apply font-bold;
+ }
+
+ @media (max-width: 751px) {
+ .menu {
+ @apply border-r-0 border-b border-gray-300;
+ }
+ }
+
+ .menu ul {
+ @apply pl-4;
+ }
+}
diff --git a/refine-remix/plugins/tailwindcss/meta.json b/refine-remix/plugins/tailwindcss/meta.json
new file mode 100644
index 000000000..ab0662175
--- /dev/null
+++ b/refine-remix/plugins/tailwindcss/meta.json
@@ -0,0 +1,4 @@
+{
+ "name": "Tailwind CSS",
+ "url": "https://refine.dev/docs/guides-concepts/general-concepts/#headless-concept"
+}
diff --git a/refine-remix/plugins/tailwindcss/package.json b/refine-remix/plugins/tailwindcss/package.json
new file mode 100644
index 000000000..9dc73ff2e
--- /dev/null
+++ b/refine-remix/plugins/tailwindcss/package.json
@@ -0,0 +1,7 @@
+{
+ "devDependencies": {
+ "tailwindcss": "^3.4.3",
+ "postcss": "^8.4.38",
+ "autoprefixer": "^10.4.19"
+ }
+}
diff --git a/refine-remix/plugins/tailwindcss/postcss.config.js b/refine-remix/plugins/tailwindcss/postcss.config.js
new file mode 100644
index 000000000..67cdf1a55
--- /dev/null
+++ b/refine-remix/plugins/tailwindcss/postcss.config.js
@@ -0,0 +1,6 @@
+module.exports = {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+};
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",
diff --git a/refine-vite/plugins/_base/extend.js b/refine-vite/plugins/_base/extend.js
index ce734aba3..801cd7bfa 100644
--- a/refine-vite/plugins/_base/extend.js
+++ b/refine-vite/plugins/_base/extend.js
@@ -28,6 +28,8 @@ module.exports = {
extend(answers) {
const uiFramework = answers["ui-framework"];
const dataProvider = answers["data-provider"];
+ const isHeadless =
+ uiFramework === "no" || uiFramework === "tailwindcss";
switch (uiFramework) {
case "antd":
@@ -102,7 +104,7 @@ module.exports = {
];
// update for headless
- if (uiFramework === "no") {
+ if (isHeadless) {
base._app.authPageProps = [
`
renderContent={(content) => (
@@ -160,16 +162,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 { Layout } from "./components/layout";`,
);
@@ -200,7 +199,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"]`;
@@ -209,7 +208,7 @@ module.exports = {
// ## blogPostCategoryTableField
if (base.isGraphQL) {
- if (uiFramework === "no") {
+ if (isHeadless) {
base.blogPostCategoryTableField = `"category.title"`;
}
if (uiFramework === "antd") {
@@ -240,7 +239,7 @@ module.exports = {
{ value: "rejected", label: "Rejected" },
]);
}
- if (uiFramework === "no" || uiFramework === "mui") {
+ if (isHeadless || uiFramework === "mui") {
base.blogPostStatusOptions = JSON.parse(base.blogPostStatusOptions);
}
@@ -252,17 +251,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-vite/plugins/_base/src/App.css b/refine-vite/plugins/_base/src/App.css
index 7d0bec252..2b664c8b2 100644
--- a/refine-vite/plugins/_base/src/App.css
+++ b/refine-vite/plugins/_base/src/App.css
@@ -1,5 +1,6 @@
body {
margin: 0px;
+ background: white;
}
table {
diff --git a/refine-vite/plugins/auth-provider-auth0/src/pages/login.tsx b/refine-vite/plugins/auth-provider-auth0/src/pages/login.tsx
index 9c4661c14..feeb66fea 100644
--- a/refine-vite/plugins/auth-provider-auth0/src/pages/login.tsx
+++ b/refine-vite/plugins/auth-provider-auth0/src/pages/login.tsx
@@ -95,7 +95,7 @@ export const Login: React.FC = () => {
);
<%_ } _%>
- <%_ 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 { AuthPage } from "@refinedev/core";
<%_ } _%>
<%_ if (answers["ui-framework"] === 'antd') { _%>
diff --git a/refine-vite/plugins/auth-provider-custom/src/pages/login/index.tsx b/refine-vite/plugins/auth-provider-custom/src/pages/login/index.tsx
index 45df0e9ab..318e16ab6 100644
--- a/refine-vite/plugins/auth-provider-custom/src/pages/login/index.tsx
+++ b/refine-vite/plugins/auth-provider-custom/src/pages/login/index.tsx
@@ -1,4 +1,4 @@
-<%_ if (answers[`ui-framework`] === "no") { _%>
+<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>
import { AuthPage } from "@refinedev/core";
<%_ } _%>
<%_ if (answers["ui-framework"] === 'antd') { _%>
diff --git a/refine-vite/plugins/auth-provider-custom/src/pages/register/index.tsx b/refine-vite/plugins/auth-provider-custom/src/pages/register/index.tsx
index 427219d03..509c34ee1 100644
--- a/refine-vite/plugins/auth-provider-custom/src/pages/register/index.tsx
+++ b/refine-vite/plugins/auth-provider-custom/src/pages/register/index.tsx
@@ -1,4 +1,4 @@
-<%_ if (answers[`ui-framework`] === "no") { _%>
+<%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>
import { AuthPage } from "@refinedev/core";
<%_ } _%>
<%_ if (answers["ui-framework"] === 'antd') { _%>
diff --git a/refine-vite/plugins/auth-provider-google/src/pages/login.tsx b/refine-vite/plugins/auth-provider-google/src/pages/login.tsx
index 4390edabd..a84ba3e25 100644
--- a/refine-vite/plugins/auth-provider-google/src/pages/login.tsx
+++ b/refine-vite/plugins/auth-provider-google/src/pages/login.tsx
@@ -129,7 +129,7 @@ export const Login: React.FC = () => {
);
<%_ } _%>
- <%_ if (answers["ui-framework"] === "no") { _%>
+ <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>
return(
{
);
<%_ } _%>
- <%_ if (answers["ui-framework"] === "no") { _%>
+ <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>
return(
}
>
- <%_ if (answers["ui-framework"] === 'no') { _%>
+ <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>
@@ -174,7 +174,7 @@ function App() {
+ <%_ if (answers["ui-framework"] === "no" || answers["ui-framework"] === "tailwindcss") { _%>