D7460N CSS-only Architecture
When to use this skill
Use this skill when working on any file in the D7460N Architecture starter template. This ensures all changes comply with the zero-dependency, CSS-only, browser-native architecture.
External Service Issues (Non-Negotiable)
When a configured external API or service fails for any reason (SSL certificate errors, network failures, authentication errors, rate limiting, HTTP errors, etc.):
- NEVER change the codebase architecture or redirect API endpoints to work around the failure.
- NEVER create local fallback files, mock data, or substitute data sources to replace the external service.
- NEVER redirect
API_BASE_URL or any configured endpoint from its declared remote origin to a local path.
- STOP immediately and advise the user on how to resolve the external service issue directly.
- Examples of correct responses:
- SSL cert error → advise the user to log into their service provider account and renew or verify the certificate.
- Network/fetch failure → advise the user to check service status, subscription, or provider dashboard.
- 4xx/5xx HTTP error → advise the user to inspect the endpoint configuration or contact the API provider.
- Creating workarounds in code for broken external services produces more code, obscures the real problem, violates Least Power, and permanently changes the architecture in ways the user did not request.
Session Continuity (Non-Negotiable)
- At the start of every session, ALWAYS read
SESSION-HANDOFF.md before making implementation decisions.
- ALWAYS re-assert the handoff "Constraint Lock" before coding changes.
- If
SESSION-HANDOFF.md conflicts with canonical architecture rules, STOP and ask for clarification.
- NEVER skip handoff review due to time pressure.
Non-Negotiable Rules
- Unless otherwise indicated, this code base shall NEVER default to, NEVER consider, NEVER refer to, NEVER suggest, and NEVER use third party dependencies.
- Third party dependencies are defined as any packaged code or system that is not able render natively (without assistance) or must be compiled and or pre-built to run in an evergreen web browser.
- Unless otherwise indicated, this code base shall ALWAYS default to, ALWAYS consider, ALWAYS refer to, ALWAYS suggest, and ALWAYS use modern, advanced, vanilla, W3C/WCAG standards compliant, accessibility-first, syntax, techniques, approaches, strategies for all project design and development.
- Established standards can ALWAYS be found here, (https://www.w3.org/TR/) and here (https://developer.mozilla.org/en-US/docs/Web).
- Unless otherwise indicated, this code base shall ALWAYS default to Single Page Application (SPA) navigational architecture.
- Unless otherwise indicated, this code base shall ALWAYS default to being a Progressive Web Application (PWA).
- Unless otherwise indicated, JS shall NEVER be used for anything (exception: modular
assets/js/*.js runtime files for API transport, oninput lifecycle orchestration, storage, and startup wiring). Modern HTML and CSS must be used for all development.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS replace JS equivalent functionality.
- Unless otherwise indicated, JS shall ALWAYS default to and ALWAYS use
document.querySelector(''); for targeting all selectors.
- Unless otherwise indicated, JS shall ALWAYS default to and ALWAYS use
oninput for ALL API CRUD operations through a shared lifecycle utility.
- Unless otherwise indicated, JS shall NEVER default to and NEVER use any user initiated event for any API CRUD operations.
- Unless otherwise indicated, JS shall NEVER default to and NEVER set or use any event listeners.
- Unless otherwise indicated, JS shall NEVER default to and NEVER set or use any listeners at all - ever.
- Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS use
<label>.
- Unless otherwise indicated, HTML markup shall ALWAYS default to and ALWAYS be semantic, minimally nested, and intuitive to developers.
- Unless otherwise indicated, the principal of Separation of Concerns between presentation and data layers shall ALWAYS be maintained.
- Unless otherwise indicated, the principal of Least Power shall ALWAYS be maintained.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS determine DOM element visibility via
:empty and :has() pseudo selectors.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use modern CSS style queries and other CSS only combinations of modern CSS techniques to design and build functionality without requiring hard or static values that would otherwise need to be maintained.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS manage light and dark mode color-scheme syntax and variables in
:root{}.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use a11y selectors when possible.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use checkboxes inside
<label>s with role="button" combined with :has(), :not, and :empty() for state machines.
- Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use a radio buttons inside a
<label> with role="button" combined with :has(), :not, and :empty() inside <nav> for global navigation.
- Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS use one single file,
index.html at project root.
- Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS be a full-bleed Holy Grail layout using the skeletal layout markup found in the
index.html file.
- Unless otherwise indicated,
<div> and <span> shall NEVER be used. ALWAYS use semantic HTML equivalents that address the intent of the element.
- Unless otherwise indicated, wrapper elements shall NEVER be nested for layout purposes. ALWAYS use CSS Grid solutions instead (e.g.,
grid-template-columns and justify-content: space-between).
Architecture
- index.html (root): Complete DOM structure, pre-built
- assets/css/layout.css: The only active CSS file; CSS Grid Holy Grail structure and all current layout
- assets/js/app.js: JS entrypoint; startup checks, console reset, and initialization wiring
- assets/js/oninput.js: Shared
oninput lifecycle; binds nav inputs, routes API calls, and injects data
- assets/js/api.js: API transport utilities; base URL, endpoint suffix resolution, fetch/parse, and logging helpers
- assets/js/storage.js: Generic storage utilities (localStorage primary, cookie fallback)
- assets/js/tour.js: Safe placeholder module for future onboarding/tour logic
- assets/images/: Static assets
Ignored (inactive for now)
- assets/js/pipeline/: Inactive; ignore for now
- assets/css/*.css (other than
layout.css): Inactive; ignore for now
When modifying this project
- All UI states, including loading states, use CSS and HTML checkboxes as state machines
- Keep JS focused on fetch/CRUD only
- Always only ever use semantic HTML markup
- Never use
<div>, <span>, class, data-*, or id — <div> and <span> shall NEVER be used; ALWAYS use semantic HTML equivalents that address the intent of the element
- NEVER nest wrapper elements for layout — ALWAYS use CSS Grid instead (e.g.,
grid-template-columns and justify-content: space-between)
- NEVER create new coding patterns — all patterns are already established; use what exists
- Adding code increases entropy — NEVER add new code or files unless the user explicitly states to
- Follow user instructions in detail — no more, no less
JS Runtime Conventions (Non-Negotiable)
- API base address is declared once; only endpoint suffix varies (for example
shell, home, about, products, events, contact)
- Initial page load MUST enter the same
oninput lifecycle path via programmatic nav radio .click()
- Shell content (
header, nav, footer, meta) is fetched/injected once per runtime session, not on every page call
- Nav radio index maps to page endpoint suffix; same DOM targets are reused for injection
- Console reporting policy: minimal timestamped success reports, verbose timestamped failure reports, and
console.clear() on startup and each lifecycle run
HTML Layout Pattern
The full-bleed Holy Grail layout from index.html. This is the canonical structure — ALWAYS follow this pattern unless otherwise stated or a more efficient way is discovered.
<app-container>
<header>
<app-logo></app-logo>
<app-user></app-user>
</header>
<nav>
<label>
<input type="radio" aria-hidden="true" name="nav">
</label>
</nav>
<main>
<article>
<h1></h1>
<section></section>
</article>
</main>
<aside></aside>
<footer>
<app-legal></app-legal>
<app-version></app-version>
</footer>
</app-container>
Layout Regions
<app-container> — Root layout wrapper; CSS Grid Holy Grail structure
<header> — Contains <app-logo> and <app-user> custom elements
<nav> — Global navigation; radio button <label> state machines (see State Machine Pattern below)
<main> — Primary content area; contains <article> with <h1>, <p>, <section> elements
<aside> — Sidebar/supplementary content
<footer> — Contains <app-legal> and <app-version> custom elements
<script type="module"> — Single script tag at end of <body>, outside <app-container>
State Machines
Consist of four parts . . .
- HTML
<label> element
- HTML
<input type="checkbox"> or <input type="radio"> - nested inside the <label>
- CSS
:has() for UI change
- JS
oninput for API CRUD operations
. . . and are built with this vanilla HTML design pattern.
<label role="button">
label text
<input type="checkbox">
</label>
Global nav items will be exactly the same but use <input type="radio" name="nav">
<nav>
<label role="button">
global nav item 01
<input type="radio" name="nav">
</label>
<label role="button">
global nav item 02
<input type="radio" name="nav">
</label>
<label role="button">
global nav item 03
<input type="radio" name="nav">
</label>
<label role="button">
global nav item 04
<input type="radio" name="nav">
</label>
<label role="button">
global nav item 05
<input type="radio" name="nav">
</label>
<nav>
1---2name: d7460n-css-only3description: D7460N Architecture — zero-dependency, CSS-only, JAMstack-based, browser-native starter template. Use when modifying HTML, CSS, or JS files in this project. Enforces CSS-driven UI state, semantic HTML, no frameworks, no dependencies, and strict separation of concerns between presentation and data layers.4license: MIT5---67# D7460N CSS-only Architecture89## When to use this skill1011Use this skill when working on any file in the D7460N Architecture starter template. This ensures all changes comply with the zero-dependency, CSS-only, browser-native architecture.1213## External Service Issues (Non-Negotiable)1415When a configured external API or service fails for any reason (SSL certificate errors, network failures, authentication errors, rate limiting, HTTP errors, etc.):1617- **NEVER** change the codebase architecture or redirect API endpoints to work around the failure.18- **NEVER** create local fallback files, mock data, or substitute data sources to replace the external service.19- **NEVER** redirect `API_BASE_URL` or any configured endpoint from its declared remote origin to a local path.20- **STOP immediately** and advise the user on how to resolve the external service issue directly.21- **Examples of correct responses:**22 - SSL cert error → advise the user to log into their service provider account and renew or verify the certificate.23 - Network/fetch failure → advise the user to check service status, subscription, or provider dashboard.24 - 4xx/5xx HTTP error → advise the user to inspect the endpoint configuration or contact the API provider.25- Creating workarounds in code for broken external services produces more code, obscures the real problem, violates Least Power, and permanently changes the architecture in ways the user did not request.2627## Session Continuity (Non-Negotiable)2829- At the start of every session, ALWAYS read `SESSION-HANDOFF.md` before making implementation decisions.30- ALWAYS re-assert the handoff "Constraint Lock" before coding changes.31- If `SESSION-HANDOFF.md` conflicts with canonical architecture rules, STOP and ask for clarification.32- NEVER skip handoff review due to time pressure.3334## Non-Negotiable Rules35361. Unless otherwise indicated, this code base shall NEVER default to, NEVER consider, NEVER refer to, NEVER suggest, and NEVER use third party dependencies.372. Third party dependencies are defined as any packaged code or system that is not able render natively (without assistance) or must be compiled and or pre-built to run in an evergreen web browser.383. Unless otherwise indicated, this code base shall ALWAYS default to, ALWAYS consider, ALWAYS refer to, ALWAYS suggest, and ALWAYS use modern, advanced, vanilla, W3C/WCAG standards compliant, accessibility-first, syntax, techniques, approaches, strategies for all project design and development.394. Established standards can ALWAYS be found here, (https://www.w3.org/TR/) and here (https://developer.mozilla.org/en-US/docs/Web).405. Unless otherwise indicated, this code base shall ALWAYS default to Single Page Application (SPA) navigational architecture.416. Unless otherwise indicated, this code base shall ALWAYS default to being a Progressive Web Application (PWA).427. Unless otherwise indicated, JS shall NEVER be used for anything (exception: modular `assets/js/*.js` runtime files for API transport, `oninput` lifecycle orchestration, storage, and startup wiring). Modern HTML and CSS must be used for all development.438. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS replace JS equivalent functionality.449. Unless otherwise indicated, JS shall ALWAYS default to and ALWAYS use `document.querySelector('');` for targeting all selectors.4510. Unless otherwise indicated, JS shall ALWAYS default to and ALWAYS use `oninput` for ALL API CRUD operations through a shared lifecycle utility.4611. Unless otherwise indicated, JS shall NEVER default to and NEVER use any user initiated event for any API CRUD operations.4712. Unless otherwise indicated, JS shall NEVER default to and NEVER set or use any event listeners.4813. Unless otherwise indicated, JS shall NEVER default to and NEVER set or use any listeners at all - ever.4914. Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS use `<label>`.5015. Unless otherwise indicated, HTML markup shall ALWAYS default to and ALWAYS be semantic, minimally nested, and intuitive to developers.5116. Unless otherwise indicated, the principal of Separation of Concerns between presentation and data layers shall ALWAYS be maintained.5217. Unless otherwise indicated, the principal of Least Power shall ALWAYS be maintained.5318. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS determine DOM element visibility via `:empty` and `:has()` pseudo selectors.5419. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use modern CSS style queries and other CSS only combinations of modern CSS techniques to design and build functionality without requiring hard or static values that would otherwise need to be maintained.5520. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS manage light and dark mode color-scheme syntax and variables in `:root{}`.5621. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use a11y selectors when possible.5722. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use checkboxes inside `<label>`s with `role="button"` combined with `:has()`, `:not`, and `:empty()` for state machines.5823. Unless otherwise indicated, CSS shall ALWAYS default to and ALWAYS use a radio buttons inside a `<label>` with `role="button"` combined with `:has()`, `:not`, and `:empty()` inside `<nav>` for global navigation.5924. Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS use one single file, `index.html` at project root.6025. Unless otherwise indicated, HTML shall ALWAYS default to and ALWAYS be a full-bleed Holy Grail layout using the skeletal layout markup found in the `index.html` file.6126. Unless otherwise indicated, `<div>` and `<span>` shall NEVER be used. ALWAYS use semantic HTML equivalents that address the intent of the element.6227. Unless otherwise indicated, wrapper elements shall NEVER be nested for layout purposes. ALWAYS use CSS Grid solutions instead (e.g., `grid-template-columns` and `justify-content: space-between`).6364## Architecture6566- **index.html** (root): Complete DOM structure, pre-built67- **assets/css/layout.css**: The only active CSS file; CSS Grid Holy Grail structure and all current layout68- **assets/js/app.js**: JS entrypoint; startup checks, console reset, and initialization wiring69- **assets/js/oninput.js**: Shared `oninput` lifecycle; binds nav inputs, routes API calls, and injects data70- **assets/js/api.js**: API transport utilities; base URL, endpoint suffix resolution, fetch/parse, and logging helpers71- **assets/js/storage.js**: Generic storage utilities (localStorage primary, cookie fallback)72- **assets/js/tour.js**: Safe placeholder module for future onboarding/tour logic73- **assets/images/**: Static assets7475### Ignored (inactive for now)7677- **assets/js/pipeline/**: Inactive; ignore for now78- **assets/css/*.css** (other than `layout.css`): Inactive; ignore for now7980## When modifying this project8182- All UI states, including loading states, use CSS and HTML checkboxes as state machines83- Keep JS focused on fetch/CRUD only84- Always only ever use semantic HTML markup85- Never use `<div>`, `<span>`, `class`, `data-*`, or `id` — `<div>` and `<span>` shall NEVER be used; ALWAYS use semantic HTML equivalents that address the intent of the element86- NEVER nest wrapper elements for layout — ALWAYS use CSS Grid instead (e.g., `grid-template-columns` and `justify-content: space-between`)87- NEVER create new coding patterns — all patterns are already established; use what exists88- Adding code increases entropy — NEVER add new code or files unless the user explicitly states to89- Follow user instructions in detail — no more, no less9091## JS Runtime Conventions (Non-Negotiable)9293- API base address is declared once; only endpoint suffix varies (for example `shell`, `home`, `about`, `products`, `events`, `contact`)94- Initial page load MUST enter the same `oninput` lifecycle path via programmatic nav radio `.click()`95- Shell content (`header`, `nav`, `footer`, `meta`) is fetched/injected once per runtime session, not on every page call96- Nav radio index maps to page endpoint suffix; same DOM targets are reused for injection97- Console reporting policy: minimal timestamped success reports, verbose timestamped failure reports, and `console.clear()` on startup and each lifecycle run9899## HTML Layout Pattern100101The full-bleed Holy Grail layout from `index.html`. This is the canonical structure — ALWAYS follow this pattern unless otherwise stated or a more efficient way is discovered.102103```html104<app-container>105 <header>106 <app-logo></app-logo>107 <app-user></app-user>108 </header>109 <nav>110 <label>111 <input type="radio" aria-hidden="true" name="nav">112 </label>113 </nav>114 <main>115 <article>116 <h1></h1>117 <section></section>118 </article>119 </main>120 <aside></aside>121 <footer>122 <app-legal></app-legal>123 <app-version></app-version>124 </footer>125</app-container>126```127128### Layout Regions129130- **`<app-container>`** — Root layout wrapper; CSS Grid Holy Grail structure131- **`<header>`** — Contains `<app-logo>` and `<app-user>` custom elements132- **`<nav>`** — Global navigation; radio button `<label>` state machines (see State Machine Pattern below)133- **`<main>`** — Primary content area; contains `<article>` with `<h1>`, `<p>`, `<section>` elements134- **`<aside>`** — Sidebar/supplementary content135- **`<footer>`** — Contains `<app-legal>` and `<app-version>` custom elements136- **`<script type="module">`** — Single script tag at end of `<body>`, outside `<app-container>`137138## State Machines139140Consist of four parts . . .141142- HTML `<label>` element143- HTML `<input type="checkbox">` or `<input type="radio">` - nested inside the `<label>`144- CSS `:has()` for UI change145- JS `oninput` for API CRUD operations146147. . . and are built with this vanilla HTML design pattern.148149```html150<label role="button">151 label text152 <input type="checkbox">153</label>154```155156Global nav items will be exactly the same but use `<input type="radio" name="nav">`157158```html159<nav>160 <label role="button">161 global nav item 01162 <input type="radio" name="nav">163 </label>164 <label role="button">165 global nav item 02166 <input type="radio" name="nav">167 </label>168 <label role="button">169 global nav item 03170 <input type="radio" name="nav">171 </label>172 <label role="button">173 global nav item 04174 <input type="radio" name="nav">175 </label>176 <label role="button">177 global nav item 05178 <input type="radio" name="nav">179 </label>180<nav>181```