fix: responsive fix

This commit is contained in:
2024-02-22 19:49:13 +00:00
parent efe51a9b5e
commit b232410d83
13 changed files with 209 additions and 129 deletions
+2 -7
View File
@@ -1,20 +1,14 @@
import postcssPlugin from "postcss";
import tailwindcss from "tailwindcss";
import cssnano from "cssnano";
import { fileExists, getProjectDir } from "~/server/lib/utils";
import { FileSchema } from "~/server/db/schema/file";
import { unpackProject } from "~/server/lib/unpack-project";
export const postcss = async (fileData: FileSchema) => {
const content = fileData.content || "";
const projectDir = getProjectDir();
if (!fileExists(projectDir)) {
return content;
}
try {
await unpackProject({ ext: "ts,tsx,js,jsx,html" });
const projectDir = await unpackProject({ ext: "ts,tsx,js,jsx,html" });
const result = await postcssPlugin([
tailwindcss({
@@ -29,6 +23,7 @@ export const postcss = async (fileData: FileSchema) => {
return result.css;
} catch (err) {
console.error("postcss error", err);
return content;
}
};
+16 -16
View File
@@ -66,22 +66,22 @@ const main = async () => {
path: "index.html",
filename: "index.html",
content: `<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>React + Tailwind Template</title>
<link rel="stylesheet" href="globals.css" />
</head>
<body>
<div id="app"></div>
<script src="index.jsx" type="module" defer></script>
</body>
</html>
`,
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>React + Tailwind Template</title>
<link rel="stylesheet" href="globals.css" />
</head>
<body>
<div id="app"></div>
<script src="index.jsx" type="module" defer></script>
</body>
</html>
`,
},
{
userId: adminUser.id,
+1
View File
@@ -23,6 +23,7 @@ export const unpackProject = async (
const projectDir = getProjectDir();
if (!fileExists(projectDir)) {
console.log("not exist", projectDir);
await fs.mkdir(projectDir, { recursive: true });
}