nk_jtb 0.26.0 → 0.27.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/.ai/skills/jtb-best-practices/SKILL.md +61 -0
- package/.ai/skills/jtb-best-practices/rules/components.md +57 -0
- package/.ai/skills/jtb-best-practices/rules/conversion.md +43 -0
- package/.ai/skills/{jtb-layouts-and-structures/SKILL.md → jtb-best-practices/rules/layouts.md} +3 -37
- package/.ai/skills/jtb-best-practices/rules/responsive.md +34 -0
- package/.ai/skills/jtb-best-practices/rules/units-and-naming.md +68 -0
- package/.ai/skills/jtb-documentation/SKILL.md +63 -64
- package/dev.html +57 -2
- package/docs/components/accordion.md +235 -197
- package/docs/components/box.md +14 -9
- package/docs/components/button.md +4 -0
- package/docs/jtb-status.md +25 -19
- package/docs/themes.md +32 -1
- package/index.html +413 -0
- package/package.json +1 -1
- package/scripts/jtb-nav.json +62 -58
- package/skills-lock.json +6 -1
- package/src/base/_root.scss +14 -4
- package/src/build.scss +6 -1
- package/src/components/_accordion.scss +1 -1
- package/src/components/_button.scss +16 -0
- package/src/extras/_nk-docs.scss +18 -18
- package/src/maps_and_variables/_colors.scss +4 -0
- package/src/utilities/_backgrounds.scss +14 -0
- package/src/utilities/_border.scss +18 -0
- package/src/utilities/_themes.scss +19 -0
- package/src/utilities/_typography.scss +15 -0
- package/tasks.md +18 -16
- package/.ai/skills/jtb-conversion/SKILL.md +0 -81
- package/docs/quick-reference.md +0 -89
- /package/docs/{showcase-typography.md → examples/showcase-typography.md} +0 -0
- /package/docs/{showcase-ui.md → examples/showcase-ui.md} +0 -0
- /package/docs/{examples/responsive-design-patterns.md → responsive-design-patterns.md} +0 -0
- /package/docs/{animation.md → review/animation.md} +0 -0
- /package/docs/{aria.md → review/aria.md} +0 -0
- /package/docs/{core-architecture.md → review/core-architecture.md} +0 -0
- /package/docs/{design-decisions.md → review/design-decisions.md} +0 -0
- /package/docs/{developer-responsive-class-generation.md → review/developer-responsive-class-generation.md} +0 -0
- /package/docs/{display-and-visibility.md → review/display-and-visibility.md} +0 -0
- /package/docs/{layer-system.md → review/layer-system.md} +0 -0
- /package/docs/{margin-padding-spacing.md → review/margin-padding-spacing.md} +0 -0
- /package/docs/{resolvers.md → review/resolvers.md} +0 -0
- /package/docs/{responsive-testing.html → review/responsive-testing.html} +0 -0
- /package/docs/{responsive-testing.md → review/responsive-testing.md} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: jtb-best-practices
|
|
3
|
+
description: >-
|
|
4
|
+
Use this skill whenever writing, reviewing, or auditing HTML and CSS that
|
|
5
|
+
uses the NK JTB framework — including component composition, utility
|
|
6
|
+
application, and layout work. Do not wait for an explicit request — if JTB
|
|
7
|
+
classes or components are being written or reviewed, this skill applies.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# NK JTB Best Practices
|
|
11
|
+
|
|
12
|
+
## Verify Before Using
|
|
13
|
+
|
|
14
|
+
Never use a class without confirming it exists in JTB source or documentation.
|
|
15
|
+
Pattern-matching from one scale to another is the most common source of invalid
|
|
16
|
+
classes in JTB — each scale is generated independently.
|
|
17
|
+
|
|
18
|
+
If a class cannot be confirmed in the SCSS source or docs, stop and check before using it.
|
|
19
|
+
|
|
20
|
+
## Quick Reference
|
|
21
|
+
|
|
22
|
+
Read the relevant rule file before writing markup. Summaries below are for
|
|
23
|
+
navigation only — the rule files take precedence.
|
|
24
|
+
|
|
25
|
+
### Units & Naming → `rules/units-and-naming.md`
|
|
26
|
+
|
|
27
|
+
- `m-1` = 1rem, `gap-05` = 0.5rem — sub-1 values drop the leading zero and decimal
|
|
28
|
+
- Values ≥ 1 with decimals use the literal decimal in HTML: `gap-1.5`, not `gap-15`
|
|
29
|
+
- All-sides shorthand is `pxy` / `mxy`, not `p` / `m`
|
|
30
|
+
- Context-aware modifiers on the component: `<button class="btn primary">`, not `.btn-primary`
|
|
31
|
+
- Logical properties by default — `margin-inline-start` not `margin-left`
|
|
32
|
+
|
|
33
|
+
### Responsive → `rules/responsive.md`
|
|
34
|
+
|
|
35
|
+
- Ask whether responsive behaviour is needed before writing any grid, flex, or visibility utility
|
|
36
|
+
- `{bp}:` for progressive layout, `to-{bp}:` for visibility windows, `on-{bp}:` for exact-range only
|
|
37
|
+
- `on-` and `to-` are only generated for `display` and `visibility`
|
|
38
|
+
- Build mobile-first — base styles first, breakpoint prefixes upward
|
|
39
|
+
|
|
40
|
+
### Components & Tokens → `rules/components.md`
|
|
41
|
+
|
|
42
|
+
- Use `bx` for bordered/padded containers — not `bg-white bdr rounded shadow`
|
|
43
|
+
- Use `btn` for all button-like controls
|
|
44
|
+
- Use `badge` for small label/tag UI before building from scratch
|
|
45
|
+
- Use `txt-muted`, `txt-primary` before reaching for palette utilities
|
|
46
|
+
- Use a local helper class when JTB cannot express a requirement — never inline styles
|
|
47
|
+
|
|
48
|
+
### Conversion → `rules/conversion.md`
|
|
49
|
+
|
|
50
|
+
- Only for converting existing non-JTB code to JTB — not for design-to-code work or building new components from scratch
|
|
51
|
+
- Treat source classes as intent references, not direct mappings
|
|
52
|
+
- Snap arbitrary values to the closest JTB token — do not preserve exact values
|
|
53
|
+
- Record actionable gaps in `jtb-conversion-notes.md` — missing utilities, token mismatches
|
|
54
|
+
- Do not create new classes just to make a single conversion easier
|
|
55
|
+
|
|
56
|
+
### Layouts & Structures → `rules/layouts.md`
|
|
57
|
+
|
|
58
|
+
- `grid` with `cols-*` for column-based structures, `flex` for single-axis arrangements
|
|
59
|
+
- Build mobile-first — add `{bp}:` utilities only when no higher-level pattern fits
|
|
60
|
+
- Fewest structural elements that cleanly express the layout
|
|
61
|
+
- Default section rhythm: `py-4-3-2` standard, `py-5-3-2` prominent
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Components & Tokens
|
|
2
|
+
|
|
3
|
+
## Framework Components First
|
|
4
|
+
|
|
5
|
+
Always check whether a framework component already expresses the structure
|
|
6
|
+
before rebuilding it with low-level utilities.
|
|
7
|
+
|
|
8
|
+
### `bx`
|
|
9
|
+
|
|
10
|
+
Use for any bordered, padded content container:
|
|
11
|
+
|
|
12
|
+
```html +code
|
|
13
|
+
<!-- correct -->
|
|
14
|
+
<div class="bx">...</div>
|
|
15
|
+
|
|
16
|
+
<!-- wrong — rebuilding what bx already does -->
|
|
17
|
+
<div class="bg-white bdr rounded shadow pxy-1">...</div>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Sub-elements: `bx-header`, `bx-content`, `bx-footer` bleed to the box edges.
|
|
21
|
+
Use them for image regions, section headers, and footers within the card.
|
|
22
|
+
|
|
23
|
+
### `btn`
|
|
24
|
+
|
|
25
|
+
Use for all button-like controls. Apply theme and size as context-aware modifiers:
|
|
26
|
+
|
|
27
|
+
```html +code
|
|
28
|
+
<button class="btn primary">Enrol Now</button>
|
|
29
|
+
<button class="btn sm">Cancel</button>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Do not rebuild pill or button shapes with low-level utilities.
|
|
33
|
+
|
|
34
|
+
### `badge`
|
|
35
|
+
|
|
36
|
+
Use for small label/tag UI before assembling the same shape from scratch.
|
|
37
|
+
Check existing badge variants before adding a new one.
|
|
38
|
+
|
|
39
|
+
## Semantic Tokens
|
|
40
|
+
|
|
41
|
+
Prefer semantic utility tokens over palette utilities when they match the intent:
|
|
42
|
+
|
|
43
|
+
| Token | Use for |
|
|
44
|
+
| ------------- | ------------------------------- |
|
|
45
|
+
| `txt-muted` | Secondary or de-emphasised text |
|
|
46
|
+
| `txt-primary` | Brand-coloured text |
|
|
47
|
+
| `bg-primary` | Brand-coloured background |
|
|
48
|
+
|
|
49
|
+
Reach for palette utilities (`txt-stone-600`, `bg-teal-100`) only when no
|
|
50
|
+
semantic token is a reasonable match.
|
|
51
|
+
|
|
52
|
+
## Local Helper Classes
|
|
53
|
+
|
|
54
|
+
When JTB cannot express a requirement, create a local helper class. Never use
|
|
55
|
+
inline styles — a class is visible, searchable, and signals a gap clearly.
|
|
56
|
+
|
|
57
|
+
Inline styles are only permitted if explicitly instructed by the developer.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Conversion
|
|
2
|
+
|
|
3
|
+
Only for converting existing non-JTB code to JTB. Do not use for
|
|
4
|
+
design-to-code work from screenshots/mockups or building new components from scratch.
|
|
5
|
+
|
|
6
|
+
If the output file is not specified, ask before proceeding.
|
|
7
|
+
|
|
8
|
+
## Conversion Order
|
|
9
|
+
|
|
10
|
+
1. Replace source classes with documented JTB utilities or components.
|
|
11
|
+
2. When the source uses arbitrary/custom values, snap to the closest existing
|
|
12
|
+
JTB token or utility instead of preserving the exact value.
|
|
13
|
+
3. Do not create new classes as a conversion shortcut.
|
|
14
|
+
4. If something appears to need a class, consider whether it should become a
|
|
15
|
+
real framework component, utility, or documented pattern.
|
|
16
|
+
5. Record only actionable gaps in `jtb-conversion-notes.md` — missing
|
|
17
|
+
utilities, unsupported patterns, or token mismatches that need a follow-up
|
|
18
|
+
decision. Do not record resolved matches, clean conversions, or decisions
|
|
19
|
+
made.
|
|
20
|
+
6. Only add local CSS when JTB cannot express the requirement.
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
- Treat source classes as intent references, not direct mappings.
|
|
25
|
+
- For color, reach for the closest JTB palette utility first (`bg-stone-50`,
|
|
26
|
+
`txt-stone-900` etc.). If the brand color maps to a semantic role, override
|
|
27
|
+
the JTB token via `:root` (e.g. `--primary`). If no palette utility or
|
|
28
|
+
semantic token is a reasonable match, record it in `jtb-conversion-notes.md`
|
|
29
|
+
and leave the decision to the developer — do not create a custom color class.
|
|
30
|
+
- Remove no-op or default classes that do not materially change the layout or
|
|
31
|
+
styling.
|
|
32
|
+
- When Tailwind transition syntax depends on unsupported `duration-*`, easing,
|
|
33
|
+
or delay utilities, simplify to the closest supported JTB transition pattern
|
|
34
|
+
and record the missing utility coverage.
|
|
35
|
+
- Keep Alpine `x-data` scoped to the element that directly owns or uses the
|
|
36
|
+
state. Do not move it to a broader parent unless multiple descendants
|
|
37
|
+
genuinely share the same state.
|
|
38
|
+
|
|
39
|
+
## Review Checklist
|
|
40
|
+
|
|
41
|
+
- Remove source-only syntax such as arbitrary value classes where a JTB utility exists.
|
|
42
|
+
- Remove classes that only restate the default behavior.
|
|
43
|
+
- Document missing utilities or unsupported patterns in `jtb-conversion-notes.md`.
|
package/.ai/skills/{jtb-layouts-and-structures/SKILL.md → jtb-best-practices/rules/layouts.md}
RENAMED
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
name: jtb-layouts-and-structures
|
|
3
|
-
description: >-
|
|
4
|
-
Use this skill whenever making layout or structural decisions — choosing
|
|
5
|
-
between grid and flex, building page shells, or structuring internal
|
|
6
|
-
component layouts. Do not wait for an explicit request — if layout or
|
|
7
|
-
structural decisions are being made, this skill applies.
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
For layout or responsive work, read:
|
|
11
|
-
|
|
12
|
-
- `docs/responsive-design.md`
|
|
13
|
-
- `docs/layouts-and-structures.md`
|
|
14
|
-
- `docs/magic-classes.md`
|
|
15
|
-
|
|
16
|
-
## Scope
|
|
17
|
-
|
|
18
|
-
Use this skill for structural layout decisions:
|
|
19
|
-
|
|
20
|
-
- page shells
|
|
21
|
-
- layout patterns
|
|
22
|
-
- reusable internal structures
|
|
23
|
-
- split layouts
|
|
24
|
-
- grid vs flex choices
|
|
25
|
-
- container and width strategy
|
|
26
|
-
- responsive visibility strategy
|
|
27
|
-
|
|
28
|
-
Do not use this skill for general documentation or for framework-internals work.
|
|
1
|
+
# Layouts & Structures
|
|
29
2
|
|
|
30
3
|
## Decision Order
|
|
31
4
|
|
|
32
|
-
1. Classify the problem first — page-level layout or internal component
|
|
33
|
-
structure?
|
|
5
|
+
1. Classify the problem first — page-level layout or internal component structure?
|
|
34
6
|
2. Choose the right primitive:
|
|
35
7
|
- `grid` with `cols-*` for column-based structures
|
|
36
8
|
- `flex` for linear, single-axis arrangements
|
|
@@ -42,13 +14,9 @@ Do not use this skill for general documentation or for framework-internals work.
|
|
|
42
14
|
5. Only escalate to custom solutions when documented primitives cannot express
|
|
43
15
|
the need cleanly.
|
|
44
16
|
|
|
45
|
-
## Markup
|
|
46
|
-
|
|
47
|
-
- Do not add `data-*` attributes unless explicitly requested.
|
|
48
|
-
|
|
49
17
|
## Rules
|
|
50
18
|
|
|
51
|
-
-
|
|
19
|
+
- Do not add `data-*` attributes unless explicitly requested.
|
|
52
20
|
- Default to the fewest structural elements that cleanly express the layout.
|
|
53
21
|
- Combine width, rhythm, and internal layout on the same element when they do
|
|
54
22
|
not need isolation.
|
|
@@ -66,5 +34,3 @@ Do not use this skill for general documentation or for framework-internals work.
|
|
|
66
34
|
- Prefer approved magic/composite classes when they express an established
|
|
67
35
|
responsive pattern more clearly than explicit breakpoint chains. Common
|
|
68
36
|
examples include `py-*`, `gap-*`, and `cols-*` patterns.
|
|
69
|
-
- Use `{bp}:` for progressive layout changes.
|
|
70
|
-
- Use `to-` and `on-` primarily for visibility windows, not layout progression.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Responsive
|
|
2
|
+
|
|
3
|
+
## Ask First
|
|
4
|
+
|
|
5
|
+
Before writing any grid, flex layout, or visibility utility, ask:
|
|
6
|
+
|
|
7
|
+
> Does this need to be responsive?
|
|
8
|
+
|
|
9
|
+
If the task or design does not specify responsive behaviour, ask before assuming.
|
|
10
|
+
Do not add or omit responsive prefixes without knowing the answer.
|
|
11
|
+
|
|
12
|
+
## Prefix Types
|
|
13
|
+
|
|
14
|
+
Three distinct prefix types — do not substitute one for another:
|
|
15
|
+
|
|
16
|
+
| Prefix | Example | Applies when |
|
|
17
|
+
| ----------- | --------------- | ------------------------------------- |
|
|
18
|
+
| `{bp}:` | `md:flex` | From breakpoint upward (min-width) |
|
|
19
|
+
| `to-{bp}:` | `to-md:hidden` | Below breakpoint (max-width) |
|
|
20
|
+
| `on-{bp}:` | `on-md:hidden` | Exactly at that breakpoint range only |
|
|
21
|
+
|
|
22
|
+
`on-` and `to-` are only generated for `display` and `visibility` utilities.
|
|
23
|
+
Do not use them for layout, spacing, or other properties — use mixins for
|
|
24
|
+
custom responsive behaviour on other properties.
|
|
25
|
+
|
|
26
|
+
## Mobile-First
|
|
27
|
+
|
|
28
|
+
Build the base layout for the smallest viewport. Add `{bp}:` prefixes to
|
|
29
|
+
progressively enhance upward. Do not start from desktop and work down.
|
|
30
|
+
|
|
31
|
+
## Common Breakpoints
|
|
32
|
+
|
|
33
|
+
`sm`, `md`, `lg`, `xl`, `xxl` — always confirm against the JTB breakpoint map
|
|
34
|
+
before using a breakpoint that is not already present in the codebase.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Units & Naming
|
|
2
|
+
|
|
3
|
+
## Scale
|
|
4
|
+
|
|
5
|
+
All numeric class values are rem. `m-1` = 1rem, `p-2` = 2rem, `gap-05` = 0.5rem.
|
|
6
|
+
|
|
7
|
+
Before using any numeric utility, confirm the value exists in the relevant map
|
|
8
|
+
in `src/maps_and_variables/`. Each utility (spacing, gap, sizing, border-radius)
|
|
9
|
+
has its own independent scale — do not assume a value is valid because it exists
|
|
10
|
+
in a different scale.
|
|
11
|
+
|
|
12
|
+
## Decimal Class Names
|
|
13
|
+
|
|
14
|
+
The class name format depends on whether the value is below or above 1:
|
|
15
|
+
|
|
16
|
+
| Value | Class name | Example |
|
|
17
|
+
| ----- | ------------------- | ------------------ |
|
|
18
|
+
| `0.5` | Drop `0.` prefix | `gap-05`, `p-025` |
|
|
19
|
+
| `1.5` | Use literal decimal | `gap-1.5`, `p-1.5` |
|
|
20
|
+
|
|
21
|
+
Sub-1 values (starting with `0.`) strip the leading zero and decimal point.
|
|
22
|
+
Values ≥ 1 with decimals are escaped in CSS (`.gap-1\.5`) but written with the
|
|
23
|
+
literal decimal in HTML. Do not apply the sub-1 rule to values ≥ 1 — `gap-15`
|
|
24
|
+
is not a valid class for 1.5rem.
|
|
25
|
+
|
|
26
|
+
## Shorthand
|
|
27
|
+
|
|
28
|
+
- All-sides padding and margin use `pxy` and `mxy`, not `p` or `m`
|
|
29
|
+
- Directional variants: `px`, `py`, `pt`, `pb`, `pl`, `pr` (and `mx`, `my`, etc.)
|
|
30
|
+
|
|
31
|
+
## Property = Class Name
|
|
32
|
+
|
|
33
|
+
Use the CSS property value directly as the class name. Do not prefix with the property name:
|
|
34
|
+
|
|
35
|
+
- `flex` not `display-flex`
|
|
36
|
+
- `relative` not `position-relative`
|
|
37
|
+
- `hidden` not `display-none`
|
|
38
|
+
|
|
39
|
+
## Axis Modifiers & Logical Properties
|
|
40
|
+
|
|
41
|
+
Axis modifiers map to logical properties internally:
|
|
42
|
+
|
|
43
|
+
| Modifier | Logical property |
|
|
44
|
+
| -------- | ----------------------------- |
|
|
45
|
+
| `-t` | `block-start` |
|
|
46
|
+
| `-b` | `block-end` |
|
|
47
|
+
| `-l` | `inline-start` |
|
|
48
|
+
| `-r` | `inline-end` |
|
|
49
|
+
| `-x` | `inline-start` + `inline-end` |
|
|
50
|
+
| `-y` | `block-start` + `block-end` |
|
|
51
|
+
|
|
52
|
+
Use logical properties in SCSS (`margin-inline-start`, not `margin-left`).
|
|
53
|
+
Physical properties are only appropriate in explicitly positioned contexts.
|
|
54
|
+
|
|
55
|
+
## Context-Aware Modifiers
|
|
56
|
+
|
|
57
|
+
Theme and size modifiers are applied directly to the component, not as
|
|
58
|
+
hyphenated suffixes:
|
|
59
|
+
|
|
60
|
+
```html +code
|
|
61
|
+
<!-- correct -->
|
|
62
|
+
<button class="btn primary">Submit</button>
|
|
63
|
+
<button class="btn sm">Cancel</button>
|
|
64
|
+
|
|
65
|
+
<!-- wrong -->
|
|
66
|
+
<button class="btn-primary">Submit</button>
|
|
67
|
+
<button class="btn-sm">Cancel</button>
|
|
68
|
+
```
|
|
@@ -6,106 +6,105 @@ description: >-
|
|
|
6
6
|
updated, this skill applies.
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Apply both this skill and `nk-documentation-best-practices`. This skill takes
|
|
10
10
|
precedence where they conflict.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Documentation Types
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### Component Documentation
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- `docs/variable-system.md` → `docs.jtb.variable-system`
|
|
16
|
+
Use for named structural classes such as `navbar`, `menu`, `bx`, or form controls.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
**Structure:**
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
1. One-line lead
|
|
21
|
+
2. `## Basic Usage` — minimum working markup
|
|
22
|
+
3. Additional examples — simple to fuller usage
|
|
23
|
+
4. `## SCSS Variables` — if the component exposes overridable variables
|
|
24
|
+
5. `## Utility Examples` — if a utility-based approach is viable, always last
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
- Update the relevant row in `docs/jtb-status.md`.
|
|
26
|
+
**Rules:**
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
- The lead describes purpose, not implementation. Do not mention specific CSS properties.
|
|
29
|
+
- Open `## Basic Usage` with `Apply the [component class] to...` — directive, not descriptive.
|
|
30
|
+
- Component class examples use `class="bx example-jtb"`.
|
|
31
|
+
- Utility examples use `class="bx example-utils"`.
|
|
32
|
+
- Place the SCSS Variables table directly after the class examples, before `## Utility Examples`.
|
|
33
|
+
- Link to `/docs/jtb/variable-system` for override instructions rather than explaining inline.
|
|
34
|
+
- `## Utility Examples` is always last. Lives in the component doc — not a separate file.
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
### Utility Documentation
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
Use for class-based APIs such as spacing, sizing, border, position, transforms,
|
|
39
|
+
and typography helpers.
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
- On section confirmation: if the section is in a component or utility doc (not
|
|
34
|
-
a skill, reference doc, or api doc), ask: "Do you want this added to a
|
|
35
|
-
showcase?"
|
|
36
|
-
- If yes, add it to the appropriate showcase file before moving on.
|
|
41
|
+
**Structure:**
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
1. Major utility groups as `##` headings when the page covers more than one family
|
|
44
|
+
2. Example groups within those sections as `###` headings when needed
|
|
45
|
+
3. Optional compact table of available properties or value groups
|
|
46
|
+
4. Available values at the end, when useful
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
**Rules:**
|
|
41
49
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
50
|
+
- Keep utility heading levels parallel.
|
|
51
|
+
- Use a compact table near the top when it helps scan the utility API quickly.
|
|
52
|
+
- Only add notes when behaviour is non-obvious.
|
|
53
|
+
- Group examples by usage, not by SCSS implementation detail.
|
|
54
|
+
- Use `+demo-folded class="bx"` for interactive examples.
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
## Code Block Attributes
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
- `class="..."` → outer demo wrapper class
|
|
59
|
+
- `preview-class="..."` → class applied to the preview container only, keeps copied code clean
|
|
60
|
+
- `+demo` / `+demo-folded` → render preview and code together
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
For layout/responsive docs, use:
|
|
52
63
|
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
64
|
+
```md
|
|
65
|
+
+demo-folded class="resizable-container with-docs-only-overrides"
|
|
66
|
+
```
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
## Examples Files
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
Quick visual references — not comprehensive docs. Two files:
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
- `docs/examples/showcase-typography.md` — font sizes, weights, families, text utilities
|
|
73
|
+
- `docs/examples/showcase-ui.md` — components and UI elements: buttons, badges, checklist, box etc.
|
|
62
74
|
|
|
63
|
-
|
|
75
|
+
Two reasons something belongs in an examples file:
|
|
64
76
|
|
|
65
|
-
|
|
77
|
+
1. **Syntax reminder** — enough variations exist that you forget the class names
|
|
78
|
+
2. **Existence reminder** — a single component worth flagging so it doesn't get overlooked
|
|
66
79
|
|
|
67
|
-
|
|
80
|
+
Format depends on content type:
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
3. Optional compact table of available properties or value groups
|
|
72
|
-
4. Available values at the end, when useful
|
|
82
|
+
- **UI components** (`showcase-ui.md`) — use `+demo-folded class="bx"` so markup is visible and copyable
|
|
83
|
+
- **Typography/syntax** (`showcase-typography.md`) — raw HTML pairing `<code>` class names with output
|
|
73
84
|
|
|
74
|
-
|
|
85
|
+
Group by component family under `##` headings. Variants sit under `###` within that group.
|
|
75
86
|
|
|
76
|
-
|
|
77
|
-
- Use a compact table near the top when it helps scan the utility API quickly.
|
|
78
|
-
- Only add notes when behaviour is non-obvious.
|
|
79
|
-
- Group examples by usage, not by SCSS implementation detail.
|
|
80
|
-
- Use `+demo-folded class="bx"` for interactive examples.
|
|
81
|
-
- Use `preview-class="..."` for preview-only layout so copied code stays clean.
|
|
82
|
-
- Use `class="..."` for the outer demo wrapper when the preview needs a container such as `bx`.
|
|
87
|
+
Do not create a new examples file for a single component. If it does not fit the two above, discuss with the user.
|
|
83
88
|
|
|
84
|
-
|
|
89
|
+
When a section of a component or utility doc is complete, ask:
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
> Do you want this added to an examples file?
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
Do not ask this for skill, reference, or API docs.
|
|
89
94
|
|
|
90
|
-
|
|
91
|
-
2. Minimum working markup — shown early with `+code`
|
|
92
|
-
3. Examples — simple to fuller usage
|
|
93
|
-
4. Customisation — variables, modifiers, or overrides
|
|
95
|
+
## Nav & Completion
|
|
94
96
|
|
|
95
|
-
|
|
97
|
+
Nav lives in `scripts/jtb-nav.json`. Route names follow `docs.jtb.{path}`:
|
|
96
98
|
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
- Include an SCSS Variables table when the component exposes overridable variables. Link to `/docs/jtb/variable-system` for override instructions rather than explaining inline.
|
|
100
|
-
- Include a `## Utility Examples` section when a utility-based approach is viable. Lives in the component doc — not a separate file.
|
|
99
|
+
- `docs/components/list.md` → `docs.jtb.components.list`
|
|
100
|
+
- `docs/variable-system.md` → `docs.jtb.variable-system`
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
All documentation lives in `docs/`. Create new documentation directly in `docs/`.
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
- `preview-class="..."` → class applied to the preview container
|
|
106
|
-
- `+demo` / `+demo-folded` → render preview and code together
|
|
104
|
+
When a doc is confirmed complete:
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
- Add it to `scripts/jtb-nav.json`.
|
|
107
|
+
- Update the relevant row in `docs/jtb-status.md`.
|
|
109
108
|
|
|
110
109
|
## Links
|
|
111
110
|
|
package/dev.html
CHANGED
|
@@ -11,9 +11,64 @@
|
|
|
11
11
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
12
12
|
</head>
|
|
13
13
|
|
|
14
|
-
<body class="
|
|
14
|
+
<body class="bg-stone-100 pxy-075">
|
|
15
15
|
|
|
16
|
+
<style>
|
|
17
|
+
:root {
|
|
18
|
+
--primary: #6b1a3c;
|
|
19
|
+
--primary-hover: color-mix(in srgb, var(--primary), white 5%);
|
|
20
|
+
--primary-active: color-mix(in srgb, var(--primary), black 5%);
|
|
21
|
+
--primary-border: transparent;
|
|
22
|
+
--on-primary: #fff;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
|
|
26
|
+
<section class="grid md:cols-2 gap-1">
|
|
27
|
+
<article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
|
|
28
|
+
<div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-300"></div>
|
|
29
|
+
<div class="flex-col flex-1 gap-075 pxy-1">
|
|
30
|
+
<span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
|
|
31
|
+
<h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Ethics Program</h3>
|
|
32
|
+
<p class="txt-xs lh-relaxed txt-stone-700 flex-1">Two comprehensive courses equipping lactation professionals with practical skills in ethical decision-making and Code-compliant practice</p>
|
|
33
|
+
<a class="btn primary rounded-full w-full txt-xs">Enrol Now $154.00</a>
|
|
34
|
+
<a class="txt-primary txt-xs font-semibold">View Details →</a>
|
|
35
|
+
</div>
|
|
36
|
+
</article>
|
|
37
|
+
|
|
38
|
+
<article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
|
|
39
|
+
<div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-400"></div>
|
|
40
|
+
<div class="flex-col flex-1 gap-075 pxy-1">
|
|
41
|
+
<span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
|
|
42
|
+
<h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Lactation Consultant Exam Prep Program</h3>
|
|
43
|
+
<p class="txt-xs lh-relaxed txt-stone-700 flex-1">13 targeted courses building core lactation science, clinical reasoning and exam strategy skills to help IBCLC candidates feel confident and ready to pass</p>
|
|
44
|
+
<a class="btn primary rounded-full w-full txt-xs">Enrol Now $1,200.00</a>
|
|
45
|
+
<a class="txt-primary txt-xs font-semibold">View Details →</a>
|
|
46
|
+
</div>
|
|
47
|
+
</article>
|
|
48
|
+
|
|
49
|
+
<article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
|
|
50
|
+
<div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-stone-300"></div>
|
|
51
|
+
<div class="flex-col flex-1 gap-075 pxy-1">
|
|
52
|
+
<span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
|
|
53
|
+
<h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">Recertify, Renew, Refresh</h3>
|
|
54
|
+
<p class="txt-xs lh-relaxed txt-stone-700 flex-1">7 focused courses mapped to the IBCLC Detailed Content Outline to refresh knowledge, update evidence-based practice for recertification</p>
|
|
55
|
+
<a class="btn primary rounded-full w-full txt-xs">Enrol Now $385.00</a>
|
|
56
|
+
<a class="txt-primary txt-xs font-semibold">View Details →</a>
|
|
57
|
+
</div>
|
|
58
|
+
</article>
|
|
59
|
+
|
|
60
|
+
<article class="bx flex-col md:flex-row p-0 overflow-hidden rounded-xl shadow-none bdr-stone-200">
|
|
61
|
+
<div class="h-8 md:h-auto md:w-8 md:min-w-8 bg-emerald-200"></div>
|
|
62
|
+
<div class="flex-col flex-1 gap-075 pxy-1">
|
|
63
|
+
<span class="txt-primary txt-xs font-bold tracking-widest uppercase">Program</span>
|
|
64
|
+
<h3 class="font-serif txt-base font-bold lh-tight txt-stone-950">New Program Name</h3>
|
|
65
|
+
<p class="txt-xs lh-relaxed txt-stone-700 flex-1">Description text here for the new 4th program that your client wants to add to the page</p>
|
|
66
|
+
<a class="btn primary rounded-full w-full txt-xs">Enrol Now $XXX.00</a>
|
|
67
|
+
<a class="txt-primary txt-xs font-semibold">View Details →</a>
|
|
68
|
+
</div>
|
|
69
|
+
</article>
|
|
70
|
+
</section>
|
|
16
71
|
<script type="module" src="/main.js"></script>
|
|
17
72
|
</body>
|
|
18
73
|
|
|
19
|
-
</html>
|
|
74
|
+
</html>
|