create-gentiq-app 0.15.0-beta.1 → 0.15.0
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/README.md +116 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,122 @@ left to run by hand.
|
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
112
|
+
## Using Tailwind in a Gentiq app
|
|
113
|
+
|
|
114
|
+
The scaffold ships **no Tailwind** — `gentiq/style.css` is already compiled, and the chat
|
|
115
|
+
and admin UIs are fully styled by it. You only need Tailwind if you are writing your own
|
|
116
|
+
components (a custom tool card, say). If you add it, read this section first: two Tailwind
|
|
117
|
+
builds in one document need one extra line to coexist, and without it they break each
|
|
118
|
+
other silently.
|
|
119
|
+
|
|
120
|
+
### Why it needs care
|
|
121
|
+
|
|
122
|
+
Tailwind guarantees that a variant (`md:`, `hover:`) is emitted *after* the plain utility
|
|
123
|
+
it is meant to override — that is the whole reason `flex-col md:flex-row` works. The
|
|
124
|
+
guarantee holds **per build**. Gentiq ships precompiled CSS, so adding Tailwind to your app
|
|
125
|
+
creates a second, independently sorted set of utilities, and concatenating them destroys
|
|
126
|
+
the ordering: whichever set lands later wins every tie, regardless of which stylesheet
|
|
127
|
+
"owns" the class.
|
|
128
|
+
|
|
129
|
+
Both directions are broken, and neither announces itself:
|
|
130
|
+
|
|
131
|
+
| Your utilities last | Gentiq's utilities last |
|
|
132
|
+
| --- | --- |
|
|
133
|
+
| Your `.flex-col` beats gentiq's `.md:flex-row` — the admin header collapses into a vertical stack at every width | Gentiq's `.grid-cols-2` beats your `.sm:grid-cols-3` — your own grids stop responding |
|
|
134
|
+
|
|
135
|
+
Reordering does not fix it, because the problem is not the order. It is that there are two
|
|
136
|
+
sorts. The fix is to collapse them back to one.
|
|
137
|
+
|
|
138
|
+
### The setup
|
|
139
|
+
|
|
140
|
+
Put this at the top of `src/index.css`, and delete `import 'gentiq/style.css'` from
|
|
141
|
+
`src/App.tsx` (this file has to load first, so it must own that import):
|
|
142
|
+
|
|
143
|
+
```css
|
|
144
|
+
/* Layer order for the document: gentiq's layers first, yours last. */
|
|
145
|
+
@layer properties, gentiq-theme, gentiq-base, gentiq-components, gentiq-utilities,
|
|
146
|
+
theme, base, components, utilities;
|
|
147
|
+
|
|
148
|
+
@import 'gentiq/style.css';
|
|
149
|
+
|
|
150
|
+
/* Theme + utilities only — NOT `@import 'tailwindcss'`. That bundles preflight,
|
|
151
|
+
and gentiq's stylesheet already ships one; a second copy lands after gentiq's
|
|
152
|
+
rules and its `border: 0 solid` resets border-color to currentColor, which
|
|
153
|
+
paints every unstyled border in the app the foreground colour. */
|
|
154
|
+
@import 'tailwindcss/theme.css' layer(theme);
|
|
155
|
+
@import 'tailwindcss/utilities.css' layer(utilities);
|
|
156
|
+
|
|
157
|
+
/* The line that actually makes the two coexist: scan gentiq's bundles so YOUR
|
|
158
|
+
build emits gentiq's classes too. One build, one sort, every variant back
|
|
159
|
+
after its base utility. Gentiq's precompiled layer is then shadowed for every
|
|
160
|
+
class you regenerate, and still supplies its custom `@utility` rules (`glass`,
|
|
161
|
+
the loader animations), whose names contend with nothing you emit. */
|
|
162
|
+
@source '../node_modules/gentiq/dist/gentiq-index.es.js';
|
|
163
|
+
@source '../node_modules/gentiq/dist/gentiq-admin.es.js';
|
|
164
|
+
|
|
165
|
+
/* Gentiq's design tokens, registered with YOUR Tailwind instance. Gentiq declares
|
|
166
|
+
the same map in its own `@theme inline`, but that lives in its compiled
|
|
167
|
+
stylesheet, which your compiler never sees — so without this block utilities
|
|
168
|
+
like `hover:border-primary/40` silently generate nothing. `inline` is what makes
|
|
169
|
+
them resolve at runtime, so ThemeProvider can keep rewriting accent and theme. */
|
|
170
|
+
@theme inline {
|
|
171
|
+
--color-background: var(--background);
|
|
172
|
+
--color-foreground: var(--foreground);
|
|
173
|
+
--color-card: var(--card);
|
|
174
|
+
--color-card-foreground: var(--card-foreground);
|
|
175
|
+
--color-popover: var(--popover);
|
|
176
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
177
|
+
--color-primary: var(--primary);
|
|
178
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
179
|
+
--color-secondary: var(--secondary);
|
|
180
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
181
|
+
--color-muted: var(--muted);
|
|
182
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
183
|
+
--color-accent: var(--accent);
|
|
184
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
185
|
+
--color-destructive: var(--destructive);
|
|
186
|
+
--color-border: var(--border);
|
|
187
|
+
--color-input: var(--input);
|
|
188
|
+
--color-ring: var(--ring);
|
|
189
|
+
|
|
190
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
191
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
192
|
+
--radius-lg: var(--radius);
|
|
193
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Do not set `body { font-family: … !important }` here. `ThemeProvider` composes the
|
|
198
|
+
configured face with `var(--font-script)` and writes it inline to `<html>` and `<body>`;
|
|
199
|
+
an `!important` rule beats that inline style and strips the per-script fallback, leaving
|
|
200
|
+
Persian and Arabic text in a serif default.
|
|
201
|
+
|
|
202
|
+
The `@source` lines cost roughly 10–13 kB gzipped, because your build re-emits the
|
|
203
|
+
utilities gentiq already shipped. That is the price of a correct cascade; the duplicate
|
|
204
|
+
rules are identical and fully shadowed.
|
|
205
|
+
|
|
206
|
+
### Layers
|
|
207
|
+
|
|
208
|
+
Gentiq publishes into `gentiq-theme`, `gentiq-base`, `gentiq-components` and
|
|
209
|
+
`gentiq-utilities` rather than the bare `theme` / `base` / `components` / `utilities`
|
|
210
|
+
(versions up to and including `0.15.0-beta.1` used the bare names). Those generic names belong to your document, and gentiq
|
|
211
|
+
claiming them is what let the two builds merge by accident in the first place. Gentiq
|
|
212
|
+
deliberately does **not** pre-register your layer names, so your stylesheet keeps the
|
|
213
|
+
position it has always had; the `@layer` statement above is where you decide the order.
|
|
214
|
+
|
|
215
|
+
The setup above works against older versions too — the `gentiq-*` layers just stay empty
|
|
216
|
+
and gentiq's stylesheet lands in `theme` / `base` / `utilities` instead, still ahead of
|
|
217
|
+
your regenerated superset.
|
|
218
|
+
|
|
219
|
+
### Checking it
|
|
220
|
+
|
|
221
|
+
The admin dashboard header is the fastest canary — it is the layout in the product that
|
|
222
|
+
leans hardest on `md:` overrides. Open `/admin` above 768px: the logo and the navigation
|
|
223
|
+
tabs sit on one row. If they are stacked vertically, your utilities are beating gentiq's
|
|
224
|
+
variants and `@source` is missing or pointing at the wrong path.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
112
228
|
## Why Gentiq?
|
|
113
229
|
|
|
114
230
|
Unlike generic boilerplates, Gentiq is built with **developer velocity** and **production scalability** in mind. It provides the "boring" parts of AI development—authentication, rate limiting, and persistence—so you can focus on building your agents.
|