nexoreui-cli 1.8.4 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37945,9 +37945,7 @@ html, body {
|
|
|
37945
37945
|
}
|
|
37946
37946
|
${animationCss}
|
|
37947
37947
|
/* End NexoreUI Theme Tokens */`;
|
|
37948
|
-
const fontImports = `@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');`;
|
|
37949
37948
|
const cleanFullCss = `@import "tailwindcss";
|
|
37950
|
-
${fontImports}
|
|
37951
37949
|
|
|
37952
37950
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
37953
37951
|
|
|
@@ -38045,22 +38043,28 @@ async function initCommand(options = {}) {
|
|
|
38045
38043
|
if (didInjectCss) {
|
|
38046
38044
|
console.log(`\x1B[32m\u2714\x1B[0m Injected Tailwind CSS v4 @theme tokens into \x1B[1m${defaultCssFile}\x1B[0m`);
|
|
38047
38045
|
}
|
|
38048
|
-
|
|
38049
|
-
|
|
38050
|
-
|
|
38051
|
-
|
|
38052
|
-
|
|
38053
|
-
|
|
38054
|
-
|
|
38055
|
-
|
|
38056
|
-
|
|
38057
|
-
|
|
38058
|
-
|
|
38059
|
-
});
|
|
38060
|
-
fs5.writeFileSync(indexHtmlPath, html, "utf8");
|
|
38061
|
-
}
|
|
38062
|
-
} catch {
|
|
38046
|
+
const indexHtmlPath = path5.join(project.baseDir, "index.html");
|
|
38047
|
+
if (fs5.existsSync(indexHtmlPath)) {
|
|
38048
|
+
try {
|
|
38049
|
+
let html = fs5.readFileSync(indexHtmlPath, "utf8");
|
|
38050
|
+
if (mode === "dark" && !html.includes('class="dark"')) {
|
|
38051
|
+
html = html.replace(/<html(\s+[^>]*)?>/i, (match) => {
|
|
38052
|
+
if (match.includes('class="')) {
|
|
38053
|
+
return match.replace('class="', 'class="dark ');
|
|
38054
|
+
}
|
|
38055
|
+
return match.replace("<html", '<html class="dark"');
|
|
38056
|
+
});
|
|
38063
38057
|
}
|
|
38058
|
+
if (!html.includes("fonts.googleapis.com")) {
|
|
38059
|
+
const fontLinks = ` <!-- NexoreUI Fonts -->
|
|
38060
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
38061
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
38062
|
+
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap" rel="stylesheet">
|
|
38063
|
+
</head>`;
|
|
38064
|
+
html = html.replace("</head>", fontLinks);
|
|
38065
|
+
}
|
|
38066
|
+
fs5.writeFileSync(indexHtmlPath, html, "utf8");
|
|
38067
|
+
} catch {
|
|
38064
38068
|
}
|
|
38065
38069
|
}
|
|
38066
38070
|
installPeerDependencies(project.baseDir, project.packageManager);
|