@baybreezy/docd 0.1.1 → 0.1.3

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.
@@ -13,17 +13,13 @@
13
13
  <div class="absolute -bottom-px left-0 h-px w-12 bg-zinc-700" />
14
14
  <div class="absolute bottom-0 -left-px h-12 w-px bg-zinc-700" />
15
15
 
16
- <p
17
- v-if="headline"
18
- class="mb-4 line-clamp-1 text-2xl text-pretty whitespace-pre-line"
19
- v-html="headline"
20
- />
21
- <h1 v-if="title" class="mb-4 line-clamp-1 text-5xl leading-none font-bold tracking-tighter">
16
+ <p v-if="headline" class="mb-4 text-2xl text-pretty whitespace-pre-line" v-html="headline" />
17
+ <h1 v-if="title" class="mb-4 text-5xl leading-none font-bold tracking-tighter">
22
18
  {{ title }}
23
19
  </h1>
24
20
  <p
25
21
  v-if="description"
26
- class="line-clamp-3 text-3xl leading-normal text-pretty whitespace-pre-line opacity-80"
22
+ class="text-3xl leading-normal text-pretty whitespace-pre-line opacity-80"
27
23
  >
28
24
  {{ description }}
29
25
  </p>
@@ -16,12 +16,12 @@
16
16
  <div class="flex flex-col items-center text-center">
17
17
  <div v-if="logoSvg" v-html="logoSvg" class="mb-5" />
18
18
 
19
- <h1 v-if="title" class="mb-4 line-clamp-1 text-5xl leading-none font-bold tracking-tighter">
19
+ <h1 v-if="title" class="mb-4 text-5xl leading-none font-bold tracking-tighter">
20
20
  {{ title }}
21
21
  </h1>
22
22
  <p
23
23
  v-if="description"
24
- class="line-clamp-3 text-3xl text-pretty whitespace-pre-line opacity-80"
24
+ class="text-3xl text-pretty whitespace-pre-line opacity-80"
25
25
  v-html="description"
26
26
  />
27
27
  </div>
package/modules/css.ts CHANGED
@@ -36,6 +36,44 @@ export default defineNuxtModule({
36
36
  },
37
37
  });
38
38
 
39
+ // Inject `@reference` into consuming-app CSS files that use `@apply` but
40
+ // don't already import or reference Tailwind. This gives them access to the
41
+ // layer's theme tokens without re-outputting Tailwind's stylesheet.
42
+ addVitePlugin({
43
+ name: "docd:inject-tailwind-reference",
44
+ enforce: "pre",
45
+ async load(id) {
46
+ const cleanId = id?.split("?")?.[0]?.replace(/\\/g, "/");
47
+
48
+ if (!cleanId?.endsWith(".css")) return null;
49
+ // Skip the layer's own tailwind entry — it already has @import "tailwindcss".
50
+ if (cleanId === tailwindCssPath) return null;
51
+ // Only touch files inside the consuming app root, not node_modules or the layer.
52
+ if (!cleanId.startsWith(`${rootDir}/`)) return null;
53
+ if (cleanId.startsWith(`${layerAppDir}/`)) return null;
54
+
55
+ let code: string;
56
+ try {
57
+ code = await readFile(cleanId, "utf8");
58
+ } catch {
59
+ return null;
60
+ }
61
+
62
+ // Skip files that already have reference
63
+ if (
64
+ code.includes('@import "tailwindcss"') ||
65
+ code.includes("@import 'tailwindcss'") ||
66
+ code.includes("@reference")
67
+ )
68
+ return null;
69
+
70
+ // Only inject when the file actually uses @apply to avoid unnecessary overhead.
71
+ if (!code.includes("@apply")) return null;
72
+
73
+ return `@reference ${JSON.stringify(tailwindCssPath)};\n${code}`;
74
+ },
75
+ });
76
+
39
77
  // Suppress noisy Vite warnings produced during Tailwind's build pass.
40
78
  nuxt.hook("vite:extendConfig", (config) => {
41
79
  const logger = config.customLogger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baybreezy/docd",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "A Nuxt layer for building documentation sites with UI Thing.",
5
5
  "repository": {
6
6
  "type": "git",