create-bestax 3.2.1 → 3.3.1
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/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -2
- package/package.json +1 -1
- package/templates/skills/bestax-layout-scaffold/SKILL.md +7 -0
- package/templates/skills/bestax-layout-scaffold/examples/landing.tsx +6 -1
- package/templates/skills/bestax-layout-scaffold/references/archetypes.md +6 -0
- package/templates/skills/bestax-layout-scaffold/references/layout-components.md +9 -9
- package/templates/skills/bestax-theming/SKILL.md +20 -0
- package/templates/skills/bestax-theming/references/css-variables.md +49 -0
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,EAAE,QAAQ,EAG/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AACpD,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,kBAAkB,QAAsB,CAAC;AAEtD,eAAO,MAAM,QAAQ;;;;;;wCAWQ,MAAM;uCAEP,MAAM;sCACP,MAAM;4CAEA,MAAM;;;;;CAM7B,CAAC;AAEX,eAAO,MAAM,OAAO;;;;;;CAOV,CAAC;AAOX,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK9D,CAAC;AAKF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,GACpB,aAAa,MAAM,EACnB,8BA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CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,EA0CtC,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -76,8 +76,8 @@ ${setupLines.join('\n')}
|
|
|
76
76
|
|
|
77
77
|
- Never inline \`style={{}}\` — use the helper props every component accepts (\`m*\`/\`p*\`
|
|
78
78
|
spacing, \`textColor\`/\`bgColor\`, \`display="flex"\`, \`flexDirection\`, \`alignItems\`).
|
|
79
|
-
Flex layouts have no \`gap\` helper — space children with margins (\`Grid\`
|
|
80
|
-
\`gap\` prop
|
|
79
|
+
Flex layouts have no \`gap\` helper — space children with margins (\`Grid\` and \`Columns\`
|
|
80
|
+
take a \`gap\` prop, so prefer that there).
|
|
81
81
|
- Compose existing components before writing custom CSS; theme via \`Theme\` and \`--bulma-*\`
|
|
82
82
|
variables, never hardcoded colors.
|
|
83
83
|
- There is no test runner or Storybook in this app — don't assume one.
|
|
@@ -91,6 +91,7 @@ automatically when the task matches:
|
|
|
91
91
|
- **bestax-form** — build forms with the bestax form components (no form library).
|
|
92
92
|
- **bestax-theming** — colors, branding, and dark mode via the \`Theme\` component (\`colorMode\`).
|
|
93
93
|
- **bestax-layout-scaffold** — scaffold full pages (app shell, landing, centered, card grid).
|
|
94
|
+
- **bestax-icons** — icons via \`Icon\`/\`IconText\`: library setup, name formats, variants, a11y.
|
|
94
95
|
|
|
95
96
|
Prefer the library's components and these skills over hand-written Bulma markup or custom CSS.
|
|
96
97
|
|
package/package.json
CHANGED
|
@@ -46,6 +46,13 @@ Centered; a collection of items → Card grid. For mixed requests, pick the domi
|
|
|
46
46
|
`textAlign="centered"`, and `textColor`/`bgColor` instead of `style={{ marginTop, textAlign,
|
|
47
47
|
color }}`. Set the app-wide icon library once with `<ConfigProvider iconLibrary="…">` at the root
|
|
48
48
|
rather than `library` on every `<Icon>`.
|
|
49
|
+
- **CTAs on a colored hero must stay legible in both schemes.** On a fixed-color surface
|
|
50
|
+
(`Hero color="primary"`, a dark banner), use **filled** buttons — `color="light"` or
|
|
51
|
+
`color="primary" isInverted` — never a thin `isOutlined` secondary: a light outline + light
|
|
52
|
+
label on a dark surface is low-contrast and gets worse under OS dark mode. And when the page's
|
|
53
|
+
design is single-mode (a fixed light or dark look), pin it at the root —
|
|
54
|
+
`<Theme isRoot colorMode="light">` — so a visitor's OS dark mode can't flip Bulma's text
|
|
55
|
+
colors out from under the fixed palette (details: the `bestax-theming` skill's contrast rules).
|
|
49
56
|
|
|
50
57
|
## References
|
|
51
58
|
|
|
@@ -33,11 +33,16 @@ export default function LandingPage() {
|
|
|
33
33
|
<SubTitle size="3">
|
|
34
34
|
The all-in-one platform for modern teams.
|
|
35
35
|
</SubTitle>
|
|
36
|
+
{/* Both CTAs are FILLED: on a fixed-color hero a thin outlined
|
|
37
|
+
button (light outline + light label) reads washed out, and
|
|
38
|
+
worse under OS dark mode. isInverted (no isOutlined) gives a
|
|
39
|
+
solid white button with primary text — high contrast in both
|
|
40
|
+
schemes. */}
|
|
36
41
|
<Buttons isCentered mt="5">
|
|
37
42
|
<Button color="light" size="large">
|
|
38
43
|
Get started
|
|
39
44
|
</Button>
|
|
40
|
-
<Button color="primary" isInverted
|
|
45
|
+
<Button color="primary" isInverted size="large">
|
|
41
46
|
Live demo
|
|
42
47
|
</Button>
|
|
43
48
|
</Buttons>
|
|
@@ -116,6 +116,12 @@ pricing page. The default for "build me a site/page".
|
|
|
116
116
|
**Responsive:** `Section`s already stack vertically. The feature `Columns` collapse to one feature
|
|
117
117
|
per row on mobile. Use `Hero size="large"` / `"fullheight"` for a taller hero.
|
|
118
118
|
|
|
119
|
+
**Hero CTAs:** on a colored hero use **filled** buttons only — `color="light"` for the primary
|
|
120
|
+
CTA and `color="primary" isInverted` (solid white, primary text) for a secondary. A thin
|
|
121
|
+
`isOutlined` button on a fixed-color surface is low-contrast and degrades further under OS dark
|
|
122
|
+
mode. Single-mode page designs should also pin the scheme at the root
|
|
123
|
+
(`<Theme isRoot colorMode="light">`) — see the `bestax-theming` skill's contrast rules.
|
|
124
|
+
|
|
119
125
|
---
|
|
120
126
|
|
|
121
127
|
## 3. Centered single-column
|
|
@@ -91,15 +91,15 @@ The responsive grid. `Columns` is the row; `Column` is a cell.
|
|
|
91
91
|
|
|
92
92
|
**Columns**
|
|
93
93
|
|
|
94
|
-
| Prop
|
|
95
|
-
|
|
|
96
|
-
| `isMultiline`
|
|
97
|
-
| `isCentered`
|
|
98
|
-
| `isVCentered`
|
|
99
|
-
| `isGapless`
|
|
100
|
-
| `isMobile`
|
|
101
|
-
| `isDesktop`
|
|
102
|
-
| `
|
|
94
|
+
| Prop | Type |
|
|
95
|
+
| -------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
96
|
+
| `isMultiline` | `boolean` (wrap cells onto new rows) |
|
|
97
|
+
| `isCentered` | `boolean` (center the row) |
|
|
98
|
+
| `isVCentered` | `boolean` (vertical centering — capital V) |
|
|
99
|
+
| `isGapless` | `boolean` |
|
|
100
|
+
| `isMobile` | `boolean` (stay side-by-side on mobile) |
|
|
101
|
+
| `isDesktop` | `boolean` |
|
|
102
|
+
| `gap` / `gapMobile` / `gapTablet` / `gapDesktop` / `gapWidescreen` / `gapFullhd` | `0`–`8` (number or string, same scale as `Grid`'s `gap`) |
|
|
103
103
|
|
|
104
104
|
**Column**
|
|
105
105
|
|
|
@@ -35,6 +35,26 @@ For **dark mode**, pass `colorMode` to `Theme` (`'light' | 'dark' | 'system'`).
|
|
|
35
35
|
`Theme`; `'system'` follows the OS `prefers-color-scheme`. Drive it from state on the app-root
|
|
36
36
|
`Theme`: `<Theme isRoot colorMode={mode}>`.
|
|
37
37
|
|
|
38
|
+
## Contrast rules (dark mode is on by default)
|
|
39
|
+
|
|
40
|
+
When nothing sets a `data-theme` attribute (omitting `colorMode` preserves an existing one, but
|
|
41
|
+
apps that never configured it have none), Bulma follows the visitor's OS: `--bulma-text`,
|
|
42
|
+
`--bulma-scheme-main`, etc. flip on a dark-mode machine even if the design never intended a dark
|
|
43
|
+
theme. Custom fixed tokens (`--my-canvas: #f6f4ec`) do **not** flip — producing near-white Bulma
|
|
44
|
+
text on the author's fixed light background. Apply exactly one of these rules whenever custom
|
|
45
|
+
color tokens or fixed-color surfaces exist:
|
|
46
|
+
|
|
47
|
+
- **Single-mode design → pin the scheme.** `<Theme isRoot colorMode="light">` (or `"dark"`), so
|
|
48
|
+
an OS preference can never invert text out from under the fixed palette.
|
|
49
|
+
- **Both modes → no exposed fixed tokens.** Derive custom tokens from scheme variables
|
|
50
|
+
(`--my-canvas: var(--bulma-scheme-main)`) — or flip them yourself under **both** dark-mode
|
|
51
|
+
paths: `[data-theme='dark']` **and** `@media (prefers-color-scheme: dark)` scoped to
|
|
52
|
+
`:root:not([data-theme])`, since `colorMode="system"` removes the attribute (snippets in
|
|
53
|
+
`references/css-variables.md`).
|
|
54
|
+
- **Fixed-color surface → fixed-color content.** On a surface that never changes (a dark hero,
|
|
55
|
+
a brand banner), pin the content's colors too: solid/filled buttons and explicit text colors,
|
|
56
|
+
never scheme-derived defaults or thin outlines that depend on the flipping scheme.
|
|
57
|
+
|
|
38
58
|
Reach for the helper props (`color` / `textColor` / `bgColor` / `colorShade`, `textSize`,
|
|
39
59
|
`textWeight`, `fontFamily`) to apply themed colors and type to individual components.
|
|
40
60
|
|
|
@@ -147,6 +147,55 @@ Under dark mode Bulma flips the scheme/text/border/background lightness variable
|
|
|
147
147
|
`Theme isRoot` or `:root` still apply on top, because they set the hue/saturation/lightness
|
|
148
148
|
channels directly.
|
|
149
149
|
|
|
150
|
+
### The single-mode contrast trap
|
|
151
|
+
|
|
152
|
+
Because the OS preference applies whenever no `data-theme` attribute is set — the default state
|
|
153
|
+
of every app that never configured `colorMode` — a light-only design silently breaks for any
|
|
154
|
+
dark-mode visitor: Bulma's text goes near-white while author-defined fixed tokens stay light —
|
|
155
|
+
white text on cream. The failure is invisible unless the author's own OS is in dark mode.
|
|
156
|
+
|
|
157
|
+
**If the design is single-mode, pin the scheme** so text can't flip out from under the palette:
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
<Theme isRoot colorMode="light">
|
|
161
|
+
<App />
|
|
162
|
+
</Theme>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**If both modes are supported, never expose a fixed custom token to the flip** — derive it from
|
|
166
|
+
scheme variables, or flip it yourself:
|
|
167
|
+
|
|
168
|
+
```css
|
|
169
|
+
/* Preferred: track the scheme automatically. */
|
|
170
|
+
:root {
|
|
171
|
+
--my-canvas: var(--bulma-scheme-main);
|
|
172
|
+
--my-ink: var(--bulma-text);
|
|
173
|
+
}
|
|
174
|
+
/* Or, when custom values must be kept, provide the dark pair for BOTH
|
|
175
|
+
ways dark mode arrives — the explicit attribute (colorMode="dark")… */
|
|
176
|
+
[data-theme='dark'] {
|
|
177
|
+
--my-canvas: #14251b;
|
|
178
|
+
--my-ink: #eef3e7;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* …and the OS preference, which applies when no data-theme is set
|
|
182
|
+
(colorMode="system" removes the attribute): */
|
|
183
|
+
@media (prefers-color-scheme: dark) {
|
|
184
|
+
:root:not([data-theme]) {
|
|
185
|
+
--my-canvas: #14251b;
|
|
186
|
+
--my-ink: #eef3e7;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Deriving from scheme variables is preferred precisely because it covers both dark-mode paths
|
|
192
|
+
with no extra selector.
|
|
193
|
+
|
|
194
|
+
The same reasoning applies to **fixed-color surfaces** inside either kind of page (a dark hero,
|
|
195
|
+
a brand banner): content sitting on a surface that never flips must use pinned colors — filled
|
|
196
|
+
buttons and explicit text colors — not scheme-derived defaults (see the layout skill's hero CTA
|
|
197
|
+
rule).
|
|
198
|
+
|
|
150
199
|
## `Theme` props (named)
|
|
151
200
|
|
|
152
201
|
Color trios: `primaryH/primaryS/primaryL`, `linkH/linkS/linkL`, `infoH/S/L`, `successH/S/L`,
|