nk_jtb 0.23.0 → 0.24.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.
Files changed (49) hide show
  1. package/.ai/guidelines/jtb-framework.md +55 -0
  2. package/.ai/prompts/create-documentation.md +7 -0
  3. package/{.opencode/prompt-code-review.md → .ai/prompts/jtb-code-review.md} +65 -73
  4. package/{.opencode/prompt-review-component-utility.md → .ai/prompts/jtb-review-component.md} +7 -11
  5. package/{.opencode/prompt-review-documentation.md → .ai/prompts/jtb-review-documentation.md} +2 -19
  6. package/.ai/prompts/misc.md +18 -0
  7. package/{.opencode/skills/tailwind-to-jtb → .ai/skills/jtb-conversion}/SKILL.md +26 -29
  8. package/.ai/skills/jtb-documentation/SKILL.md +174 -0
  9. package/{.opencode → .ai}/skills/jtb-layout/SKILL.md +51 -60
  10. package/.ai/skills/scss-engineer/SKILL.md +16 -0
  11. package/{.opencode/.markdownlint.json → .markdownlint.json} +1 -0
  12. package/CLAUDE.md +144 -0
  13. package/docs/api/variables.md +17 -24
  14. package/docs/components/box.md +83 -174
  15. package/docs/components/list.md +99 -0
  16. package/docs/quick-reference.md +89 -0
  17. package/docs/showcase-typography.md +84 -212
  18. package/docs/showcase-ui.md +38 -0
  19. package/docs/utilities/typography.md +195 -0
  20. package/docs/variable-system.md +33 -96
  21. package/docs-main.js +9 -0
  22. package/docs.html +20 -0
  23. package/framework-status.md +125 -29
  24. package/index.html +1 -134
  25. package/package.json +8 -4
  26. package/readme.md +0 -12
  27. package/scripts/ai-sync.js +210 -0
  28. package/scripts/markdown-loader.js +27 -0
  29. package/scripts/markdown-renderer.js +123 -0
  30. package/scripts/nav.json +70 -0
  31. package/scripts/navigation.js +63 -0
  32. package/skills-lock.json +20 -0
  33. package/src/base/_root.scss +2 -3
  34. package/src/base/_typography.scss +1 -1
  35. package/src/build.scss +12 -1
  36. package/src/components/_box.scss +1 -1
  37. package/src/components/_list.scss +19 -21
  38. package/src/components/index.scss +4 -4
  39. package/src/maps_and_variables/_components.scss +27 -27
  40. package/src/maps_and_variables/_value-maps.scss +2 -2
  41. package/vite.config.js +4 -1
  42. package/.opencode/DIRECTORY_TYPES.md +0 -133
  43. package/.opencode/agents/scss-engineer.md +0 -169
  44. package/.opencode/context/working-with-nathan.md +0 -72
  45. package/.opencode/skills/jtb-documentation/SKILL.md +0 -249
  46. package/.opencode/skills/markdown-formatting/SKILL.md +0 -79
  47. package/AGENTS.md +0 -110
  48. package/docs/customisation.md +0 -44
  49. package/docs/layouts-and-structures-next.md +0 -149
@@ -0,0 +1,55 @@
1
+ # NK JTB Framework
2
+
3
+ NK JTB (NayKel Just the Basics) is a utility-based SCSS/CSS framework — a
4
+ lightweight Tailwind-like alternative. Components provide structure; utilities
5
+ add styling.
6
+
7
+ > JTB follows similar principles to Tailwind but has different naming
8
+ > conventions and uses logical properties. Always refer to JTB documentation for
9
+ > correct scales, breakpoints, and class names. Tailwind values are intent
10
+ > references only — never direct mappings.
11
+
12
+ ## Naming Conventions
13
+
14
+ - **Numbers = rem** — `m-1` = 1rem, `p-2` = 2rem, `gap-05` = 0.5rem (sub-1
15
+ values drop the leading zero and decimal)
16
+ - **Property = class name** — use `relative`, `sticky`, `flex` directly. Never
17
+ `position-relative` or `display-flex`
18
+ - **Axis modifiers** — `-t`, `-b`, `-l`, `-r`, `-x`, `-y` map to logical
19
+ properties internally (e.g. `-t` → `block-start`, `-l` → `inline-start`)
20
+ - **Context-aware modifiers** — `.primary`, `.xs`, `.rounded` adapt to their
21
+ component. Use `<button class="btn primary">` not `.btn-primary`
22
+ - **Logical properties by default** — use logical properties
23
+ (`margin-inline-start`) not physical (`margin-left`). Physical properties only
24
+ in explicitly positioned contexts
25
+
26
+ ## Responsive Prefixes
27
+
28
+ Three distinct prefix types — do not substitute one for another:
29
+
30
+ - **`{bp}:`** (e.g. `md:flex`) — applies from breakpoint upward. Primary pattern
31
+ for progressive layout and styling
32
+ - **`to-{bp}:`** (e.g. `to-md:hidden`) — applies below breakpoint. Use for
33
+ visibility windows
34
+ - **`on-{bp}:`** (e.g. `on-md:hidden`) — applies only within that breakpoint
35
+ range, non-cascading. Use for exact-range targeting
36
+
37
+ `on-` and `to-` are only generated for `display` and `visibility` utilities —
38
+ this is intentional. Use mixins for custom responsive behavior on other
39
+ properties.
40
+
41
+ ## Auto Spacing
42
+
43
+ The framework automatically adds `margin-block-start` between content elements.
44
+ Do not manually add top margins between standard content elements — the spacing
45
+ system handles it. Elements inside flex or grid containers have margins reset;
46
+ use `gap` instead.
47
+
48
+ ## Prohibited Patterns
49
+
50
+ - `@import` — use `@use` / `@forward`
51
+ - Component-specific modifiers like `.btn-primary` — use `<button class="btn
52
+ primary">`
53
+ - Hardcoded values — use variables
54
+ - Deep nesting — maximum 3 levels
55
+ - `!important` — never use
@@ -0,0 +1,7 @@
1
+ Create documentation for the `[component].scss` component, following the conventions and architecture rules defined in the JTB documentation.
2
+
3
+ Invoke the `jtb-documentation` skill before starting. Read these in full first
4
+ — these define what is correct:
5
+
6
+ - `introduction.md`
7
+ - `docs/conventions-and-architecture-rules.md`
@@ -1,73 +1,65 @@
1
- # Code Review Prompt for NK JTB SCSS Framework
2
-
3
- Before reviewing, load and read these files in full:
4
-
5
- - `AGENTS.md`
6
- - `SKILL.md`
7
- - `scss-engineer.md`
8
- - `working-with-nathan.md`
9
- -
10
-
11
- You are reviewing code for the NK JTB SCSS Framework. Please follow these
12
- guidelines:
13
-
14
- - **Framework Alignment:** Ensure all code strictly follows the JTB conventions,
15
- naming, and architecture as described in the documentation. Do not use
16
- Tailwind or other frameworks as reference for implementation details.
17
- - **Directory Structure:** Verify files are placed in the correct directories
18
- (`base`, `components`, `forms`, `utilities`, `mixins`, `functions`,
19
- `maps_and_variables`).
20
- - **Import Rules:** Check that only `@use` and `@forward` are used for imports.
21
- `@import` is prohibited.
22
- - **Component Structure:** Components should provide structure only, not
23
- decoration. Styling must be handled by utilities.
24
- - **Modifiers:** Only use context-aware modifiers (e.g., `.primary`), never
25
- component-specific ones (e.g., `.btn-primary`).
26
- - **Variables:** All values must use variables or maps—no hardcoded values.
27
- - **Nesting:** No selector nesting deeper than 3 levels.
28
- - **Override Order:** Confirm the import order: base → components → forms →
29
- utilities.
30
- - **Documentation:** All new or changed code must be documented using the JTB
31
- documentation conventions. Drafts go in `docs-for-review/`, finalized docs in
32
- `docs/`.
33
-
34
- **Review Checklist:**
35
-
36
- 1. Does the code follow JTB naming, structure, and logical property conventions?
37
- 2. Are all values variable-driven and override-friendly?
38
- 3. Is the code placed in the correct directory and imported in the right order?
39
- 4. Are all prohibited patterns (see AGENTS.md) avoided?
40
- 5. Is documentation provided or updated as required?
41
-
42
- Provide clear, actionable feedback. If you suggest changes, reference the
43
- specific JTB documentation section or rule.
44
-
45
- ## Skill & Agent File Review
46
-
47
- When any of the source-of-truth files are included in the changeset, review them
48
- for accuracy against the actual codebase:
49
-
50
- **Accuracy**
51
-
52
- - Do the documented conventions match how the SCSS actually works?
53
- - Are examples valid and runnable — not invented or outdated?
54
- - Do file paths, class names, and patterns reflect the real codebase?
55
-
56
- **Completeness**
57
-
58
- - Are new patterns or workflows introduced in this PR documented?
59
- - Are deprecated patterns removed or flagged?
60
-
61
- **Internal Consistency**
62
-
63
- - Do the files agree with each other? Flag any contradictions between
64
- `scss-engineer.md`, `SKILL.md`, `AGENTS.md`, and `working-with-nathan.md`
65
- - Does a change in one file require an update in another?
66
-
67
- **Scope Drift**
68
-
69
- - Do changes silently expand or restrict the agent/skill scope without clear intent?
70
-
71
- **Output Format:**
72
- List issues grouped by file. For each issue: severity (blocking/suggestion),
73
- the violated rule, and a suggested fix.
1
+ Review the code changes for the NK JTB SCSS framework.
2
+
3
+ Invoke the `jtb-documentation` skill before starting.
4
+
5
+ ## Guidelines
6
+
7
+ - **Framework Alignment:** Ensure all code strictly follows JTB conventions,
8
+ naming, and architecture. Do not use Tailwind or other frameworks as reference
9
+ for implementation details.
10
+ - **Directory Structure:** Verify files are placed in the correct directories
11
+ (`base`, `components`, `forms`, `utilities`, `mixins`, `functions`,
12
+ `maps_and_variables`).
13
+ - **Import Rules:** Only `@use` and `@forward` are permitted. `@import` is
14
+ prohibited.
15
+ - **Component Structure:** Components should provide structure only, not
16
+ decoration. Styling must be handled by utilities.
17
+ - **Modifiers:** Only use context-aware modifiers (e.g., `.primary`), never
18
+ component-specific ones (e.g., `.btn-primary`).
19
+ - **Variables:** All values must use variables or maps — no hardcoded values.
20
+ - **Nesting:** No selector nesting deeper than 3 levels.
21
+ - **Override Order:** Confirm the import order: base → components → forms →
22
+ utilities.
23
+ - **Documentation:** All new or changed code must be documented using JTB
24
+ documentation conventions. Drafts go in `docs-for-review/`, finalized docs
25
+ in `docs/`.
26
+
27
+ ## Review Checklist
28
+
29
+ 1. Does the code follow JTB naming, structure, and logical property conventions?
30
+ 2. Are all values variable-driven and override-friendly?
31
+ 3. Is the code placed in the correct directory and imported in the right order?
32
+ 4. Is documentation provided or updated as required?
33
+
34
+ Provide clear, actionable feedback. If you suggest changes, reference the
35
+ specific JTB documentation section or rule.
36
+
37
+ ## Skill File Review
38
+
39
+ When any source-of-truth files are included in the changeset, review them for
40
+ accuracy against the actual codebase.
41
+
42
+ **Accuracy**
43
+
44
+ - Do the documented conventions match how the SCSS actually works?
45
+ - Are examples valid and runnable — not invented or outdated?
46
+ - Do file paths, class names, and patterns reflect the real codebase?
47
+
48
+ **Completeness**
49
+
50
+ - Are new patterns or workflows introduced in this changeset documented?
51
+ - Are deprecated patterns removed or flagged?
52
+
53
+ **Internal Consistency**
54
+
55
+ - Do the files agree with each other? Flag contradictions between skill files
56
+ and documentation.
57
+ - Does a change in one file require an update in another?
58
+
59
+ **Scope Drift**
60
+
61
+ - Do changes silently expand or restrict the skill scope without clear intent?
62
+
63
+ **Output Format:**
64
+ List issues grouped by file. For each issue: severity (blocking/suggestion),
65
+ the violated rule, and a suggested fix.
@@ -1,15 +1,11 @@
1
- # JTB Component/Utility Review
1
+ Review the `[component]` component.
2
2
 
3
- Review the menu component.
4
-
5
- Before reviewing, load and read these files in full:
6
-
7
- - `AGENTS.md`
8
- - `docs/conventions-and-architecture-rules.md`
3
+ Invoke the `jtb-documentation` skill before starting. Read
4
+ `docs/conventions-and-architecture-rules.md` in full.
9
5
 
10
6
  ## Scope
11
7
 
12
- Review only the named target and its directly related docs/examples.
8
+ Review only the named target and its directly related docs and examples.
13
9
 
14
10
  ## Review Questions
15
11
 
@@ -17,8 +13,8 @@ Review only the named target and its directly related docs/examples.
17
13
  2. Does the code follow JTB rules and conventions?
18
14
  3. Does it match the JTB philosophy and architecture rules?
19
15
  4. Are there any mismatches between docs and code?
20
- 5. Are there any prohibited patterns from `AGENTS.md` in this target?
21
- 6. Are there target-level bugs/regressions visible?
16
+ 5. Are there any prohibited patterns in this target?
17
+ 6. Are there target-level bugs or regressions visible?
22
18
 
23
19
  ## Priority Definitions
24
20
 
@@ -34,7 +30,7 @@ Review only the named target and its directly related docs/examples.
34
30
  - Suggest improvements with trade-offs.
35
31
  - If something is unclear or inconsistent, call it out explicitly.
36
32
 
37
- Write results to `review-[target].md` in the project root.
33
+ Write results to `review-[component].md` in the project root.
38
34
 
39
35
  Use these sections in order:
40
36
 
@@ -1,17 +1,11 @@
1
- # JTB Documentation Review
2
-
3
1
  Review the documentation for the JTB framework.
4
2
 
5
- Load and read these in full first. These define what is correct:
3
+ Invoke the `jtb-documentation` skill before starting. Read these in full first
4
+ — these define what is correct:
6
5
 
7
6
  - `introduction.md`
8
7
  - `docs/conventions-and-architecture-rules.md`
9
8
 
10
- Also load:
11
-
12
- - `AGENTS.md` — intended source of truth, but flag any contradictions with the
13
- above.
14
-
15
9
  ## Goals
16
10
 
17
11
  1. Validate what exists — is documentation correct, consistent, and
@@ -27,8 +21,6 @@ This review runs in three passes:
27
21
  2. **Triage** — decide what's worth pursuing before any work happens.
28
22
  3. **Sweep** — act only on approved items.
29
23
 
30
- ---
31
-
32
24
  ## Scope
33
25
 
34
26
  Review only:
@@ -42,8 +34,6 @@ Do not review:
42
34
  - `src/functions/` — build system internals
43
35
  - `src/base/` — output layer
44
36
 
45
- ---
46
-
47
37
  ## Review Questions
48
38
 
49
39
  ### Validation
@@ -64,13 +54,8 @@ Do not review:
64
54
  2. Are there conventions described in the docs with no implementation in
65
55
  `src/maps_and_variables/`?
66
56
 
67
- ---
68
-
69
57
  ## Priority Definitions
70
58
 
71
- > Priorities are tentative in early passes — they guide triage, not final
72
- > decisions.
73
-
74
59
  - `critical` — contradicts a source of truth or produces incorrect guidance.
75
60
  Must fix.
76
61
  - `high` — likely causes confusion, inconsistency, or future breakage. Should
@@ -78,8 +63,6 @@ Do not review:
78
63
  - `low` — style, preference, or minor improvement. Fix if you want.
79
64
  - `missing` — expected content that isn't there.
80
65
 
81
- ---
82
-
83
66
  ## Output Requirements
84
67
 
85
68
  - Be direct and critical.
@@ -0,0 +1,18 @@
1
+ I have been working on the `jtb-documentation` skill at
2
+ C:\Users\natha\sites\nk_jtb\.ai\skills\jtb-documentation\SKILL.md. Read it
3
+ before we start.
4
+
5
+ I want to continue refining skills, guidelines, and framework documentation.
6
+
7
+ The next few threads I want to pull on:
8
+
9
+ - Utility Documentation section in the skill — never discussed, needs review
10
+
11
+ - Utility-based examples alongside class-based component docs — how to structure
12
+ and where they live. For example, the checklist component is a good candidate
13
+ for a utility-based example, but where does it go? Does it live in the
14
+ component doc, or do we create a separate utility-based example doc?
15
+
16
+ - Variable system document. I think this is full of rubbish and hard to make
17
+ sense of. needs a rethink and rewrite. maybe it should be a living document
18
+ that we update as we go, rather than trying to get it right in one go?
@@ -1,40 +1,39 @@
1
1
  ---
2
- name: tailwind-to-jtb
3
- description: Convert Tailwind-oriented HTML and class usage to NK JTB framework classes and documented patterns. Use when updating markup that currently uses Tailwind classes, arbitrary values, or Tailwind-style responsive/layout conventions and the goal is to express the same intent with JTB.
2
+ name: jtb-conversion
3
+ description: >-
4
+ Use this skill whenever applying or converting to NK JTB classes and
5
+ components, regardless of the source — Tailwind, custom CSS, plain HTML,
6
+ PHP, JS, or any other context. Do not wait for an explicit request — if JTB
7
+ classes or components are being applied or converted, this skill applies.
4
8
  ---
5
9
 
6
- Read `AGENTS.md` first. For responsive or layout conversion, read:
10
+ For layout decisions during conversion, invoke the `jtb-layout` skill.
7
11
 
8
- - `docs/responsive-design.md`
9
- - `docs/conventions-and-architecture-rules.md`
10
- - `docs/layer-system.md`
12
+ If the output file is not specified, ask before proceeding.
11
13
 
12
14
  ## Conversion Order (review)
13
15
 
14
- 1. Replace Tailwind classes with documented JTB utilities or components.
16
+ 1. Replace source classes with documented JTB utilities or components.
15
17
  2. When the source uses arbitrary/custom values, snap to the closest existing
16
- JTB token or utility instead of preserving the exact Tailwind value.
18
+ JTB token or utility instead of preserving the exact value.
17
19
  3. Do not create new classes as a conversion shortcut.
18
20
  4. If something appears to need a class, consider whether it should become a
19
21
  real framework component, utility, or documented pattern.
20
- 5. Record any imperfect token match or missing framework support in a root-level
21
- notes file for review.
22
+ 5. Record only actionable gaps in `jtb-conversion-notes.md` missing
23
+ utilities, unsupported patterns, or token mismatches that need a follow-up
24
+ decision. Do not record resolved matches, clean conversions, or decisions
25
+ made.
22
26
  6. Only add local CSS when JTB cannot express the requirement.
23
27
 
24
28
  ## Rules (review)
25
29
 
26
- - Treat Tailwind classes as intent references, not direct mappings.
30
+ - Treat source classes as intent references, not direct mappings.
31
+ - For color, reach for the closest JTB palette utility first (`bg-stone-50`,
32
+ `txt-stone-900` etc.). If the brand color maps to a semantic role, override
33
+ the JTB token via `:root` (e.g. `--primary`). If no palette utility or
34
+ semantic token is a reasonable match, record it in `jtb-conversion-notes.md`
35
+ and leave the decision to the developer — do not create a custom color class.
27
36
  - Prefer documented JTB scales, breakpoints, and logical-property utilities.
28
- - When replacing `max-w-* mx-auto px-*` wrappers, check whether a `container-*`
29
- utility already expresses the same intent without extra horizontal padding.
30
- - For normal page sections, prefer `container` first.
31
- - Only step up to a `container-*` variant when the page type or reading width
32
- clearly calls for it.
33
- - Keep padding ownership on the section or component where possible. Use the
34
- container for width, not as the default home for reusable section spacing.
35
- - When a section uses a common responsive rhythm, prefer the documented magic
36
- class pattern such as `py-4-3-2` or `py-5-3-2` instead of expanding the same
37
- breakpoint sequence by hand.
38
37
  - Prefer framework components when the structure already matches what they
39
38
  provide. Common examples include `navbar`, `bx`, `bx-header`, `bx-content`,
40
39
  `bx-footer`, and `divide-y`.
@@ -49,22 +48,20 @@ Read `AGENTS.md` first. For responsive or layout conversion, read:
49
48
  styling.
50
49
  - Prefer semantic utility tokens such as `txt-muted` when they match the intent,
51
50
  instead of repeatedly assembling the same low-level token combination.
52
- - If JTB cannot express a requirement, prefer a small reusable local helper
53
- class over repeating the same inline styles across multiple elements.
51
+ - If JTB cannot express a requirement, create a local helper class. Never use
52
+ inline styles — a class is visible, searchable, and signals a gap clearly.
53
+ Inline styles are only permitted if explicitly instructed by the developer.
54
54
  - When Tailwind transition syntax depends on unsupported `duration-*`, easing,
55
55
  or delay utilities, simplify to the closest supported JTB transition pattern
56
56
  and record the missing utility coverage.
57
57
  - Keep Alpine `x-data` scoped to the element that directly owns or uses the
58
58
  state. Do not move it to a broader parent unless multiple descendants
59
59
  genuinely share the same state.
60
- - Use `{bp}:` for progressive changes.
61
- - Use `to-` / `on-` for visibility windows.
62
- - Keep visibility logic consistent within the same layout shell.
63
60
  - Do not create new classes just to make a single conversion easier.
64
61
 
65
62
  ## Review Checklist (review)
66
63
 
67
- - Remove Tailwind-only syntax such as arbitrary value classes where a JTB
64
+ - Remove source-only syntax such as arbitrary value classes where a JTB
68
65
  utility exists.
69
66
  - Check whether an existing component expresses the structure more cleanly than
70
67
  rebuilding it with low-level utilities.
@@ -74,6 +71,6 @@ Read `AGENTS.md` first. For responsive or layout conversion, read:
74
71
  local helper instead.
75
72
  - Remove classes that only restate the default behavior.
76
73
  - Check whether a nearby JTB token is acceptable before creating custom CSS.
77
- - Document missing utilities or unsupported patterns in a root-level notes file.
74
+ - Document missing utilities or unsupported patterns in
75
+ `jtb-conversion-notes.md`.
78
76
  - Flag framework gaps that should become docs or utilities later.
79
-
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: jtb-documentation
3
+ description: >-
4
+ Use this skill whenever creating or updating NK JTB framework documentation.
5
+ Do not wait for an explicit request — if documentation is being created or
6
+ updated, this skill applies.
7
+ ---
8
+
9
+ ## Documentation Locations
10
+
11
+ - **All documentation** → `docs/`
12
+
13
+ ## Workflow
14
+
15
+ - Create new documentation directly in `docs/`.
16
+ - Mark every new heading with `(review)` until its content is confirmed.
17
+ - When you update a section carrying `(review)`, ask: "[Section name] has been
18
+ updated. Is this section complete?"
19
+ - On confirmation: remove the `(review)` tag. If the confirmed section is in a
20
+ component or utility doc (not a skill, reference doc, or api doc), ask: "Do
21
+ you want this added to a showcase?"
22
+ - If yes, add it to the appropriate showcase file before moving on.
23
+ - Leave `(review)` on any headings that are still unresolved.
24
+
25
+ ## Showcases
26
+
27
+ Showcases are quick visual references — not comprehensive docs. There are three
28
+ showcase files:
29
+
30
+ - `docs/showcase-typography.md` — font sizes, weights, families, text utilities
31
+ - `docs/showcase-ui.md` — components and UI elements: buttons, badges,
32
+ checklist, box etc.
33
+ - `docs/showcase-layouts.md` — grid, flex patterns, page structures
34
+
35
+ Two reasons something belongs in a showcase:
36
+
37
+ 1. **Syntax reminder** — enough variations exist that you forget the class names
38
+ (border, typography)
39
+ 2. **Existence reminder** — a single component worth flagging so it doesn't get
40
+ overlooked (checklist)
41
+
42
+ Showcase entries have no explanation — just enough to jog memory. Format depends
43
+ on content type:
44
+
45
+ - **UI components** (`showcase-ui.md`) — use `+demo-folded` so markup is visible
46
+ and copyable
47
+ - **Typography/syntax** (`showcase-typography.md`) — use raw HTML pairing
48
+ `<code>` class names with output
49
+ - **Layouts** (`showcase-layouts.md`) — case by case
50
+
51
+ Group entries by component family under `##` headings (e.g. `## Lists`, `##
52
+ Buttons`). Individual variants sit under `###` within that group.
53
+
54
+ Do not create a new showcase file for a single component — if it doesn't fit the
55
+ three above, discuss with the user.
56
+
57
+ ## Documentation Types
58
+
59
+ Choose the document shape based on what is being documented.
60
+
61
+ ### Utility Documentation
62
+
63
+ Use for class-based APIs such as spacing, sizing, border, position, transforms,
64
+ and typography helpers.
65
+
66
+ Default structure:
67
+
68
+ 1. Title
69
+ 2. One-line lead
70
+ 3. Major utility groups as `##` headings when the page covers more than one
71
+ family
72
+ 4. Example groups within those sections as `###` headings when needed
73
+ 5. Optional compact table of available properties or value groups
74
+ 6. Available values at the end, when useful
75
+
76
+ Rules:
77
+
78
+ - Let the examples do most of the work.
79
+ - Keep prose short.
80
+ - Use `##` for major utility families such as `Border` and `Outline` when the
81
+ page covers multiple related groups.
82
+ - Use `###` for example groups within those families such as `Width`, `Color`,
83
+ `Style`, or `Offset`.
84
+ - Keep utility heading levels parallel. Do not mix levels unevenly when the
85
+ groups are peers.
86
+ - Use a compact table near the top when it helps scan the utility API quickly.
87
+ - Only add notes when behaviour is non-obvious.
88
+ - Keep review notes, implementation commentary, and TODOs out of the main doc.
89
+ - Group examples by usage, not by SCSS implementation detail.
90
+ - Use `+demo-folded class="bx"` for interactive examples.
91
+ - Use `preview-class="..."` for preview-only layout or styling so copied code
92
+ stays clean.
93
+ - Use `class="..."` for the outer demo wrapper when the preview needs a
94
+ container such as `bx`.
95
+
96
+ ### Component Documentation
97
+
98
+ Use for named structural classes such as `navbar`, `menu`, `bx`, or form
99
+ controls.
100
+
101
+ Every component doc must communicate four things — heading names can flex to
102
+ suit the content:
103
+
104
+ 1. **What it is** — a one-line lead describing purpose, not implementation
105
+ 2. **How to use it** — minimum working markup shown early with `+code`
106
+ 3. **What it looks like** — examples moving from simple to fuller usage
107
+ 4. **How to customise it** — variables, modifiers, or overrides
108
+
109
+ Rules:
110
+
111
+ - Do not add a separate `## Introduction` heading — the lead is the
112
+ introduction.
113
+ - The lead describes what the component is and does — not implementation
114
+ details. Do not mention specific CSS properties. Those may change; the
115
+ component's purpose does not.
116
+ - Heading names should match the content. A single component might use `##
117
+ Structure` and `## Basic Usage`. A page covering base styles and variants
118
+ might use `## Base` and `## Variants`. Use whatever is clearest.
119
+ - Show the minimum working structure early with `+code`.
120
+ - Use prose where structure or context-aware behaviour needs explanation.
121
+ - Move from simple usage to fuller examples.
122
+ - Wrap all interactive examples in `class="bx"` on the demo block so they are
123
+ visually presented in context.
124
+ - Include an SCSS Variables table when the component exposes overridable
125
+ variables. Link to `/docs/jtb/variable-system` for override instructions
126
+ rather than explaining inline.
127
+ - Include a `## Utility Examples` section when a utility-based approach to the
128
+ same pattern is viable. This lives in the component doc — not a separate
129
+ file. It shows the utility-built version alongside the component class.
130
+
131
+ ## Prose vs Code
132
+
133
+ Default to code-first. Add prose only when:
134
+
135
+ - Context-aware behaviour needs explanation
136
+ - Non-obvious structure requires a note
137
+ - Foundational patterns apply across multiple examples
138
+
139
+ ## Code Block Attributes
140
+
141
+ - `class="..."` → outer demo wrapper class
142
+ - `preview-class="..."` → class applied to the preview container
143
+ - `+demo` / `+demo-folded` → render preview and code together
144
+
145
+ Prefer `preview-class` when the layout is only for the preview. That keeps the
146
+ example code cleaner when copied.
147
+
148
+ For layout/responsive docs, use `class="resizable-container
149
+ with-docs-only-overrides"` so the example preview can respond inside the docs
150
+ without changing the copied markup.
151
+
152
+ ## Links
153
+
154
+ Docs are served from a Laravel app. Always use app-rooted paths — never relative
155
+ file paths:
156
+
157
+ - `/docs/jtb/variable-system` ✅
158
+ - `../variable-system.md` ❌
159
+
160
+ The base path is `/docs/jtb/` followed by the directory and filename without
161
+ extension — mirroring the `docs/` folder structure:
162
+
163
+ - `docs/components/list.md` → `/docs/jtb/components/list`
164
+ - `docs/api/helpers.md` → `/docs/jtb/api/helpers`
165
+ - `docs/variable-system.md` → `/docs/jtb/variable-system`
166
+
167
+ ## Formatting Rules
168
+
169
+ - **No horizontal rules (`---`)** — ever. Use headings and spacing
170
+ - **Concise** — get to the point
171
+ - **Show code** — examples over explanation
172
+ - **Document the non-obvious** — skip what's clear from context
173
+ - **Call out outstanding review tags** — when closing documentation work, say
174
+ which headings or docs still carry `(review)` tags