From 707ff20900a282968c9c816ded4fe5b7e18d09aa Mon Sep 17 00:00:00 2001 From: Jason McCormick Date: Fri, 27 Nov 2026 11:59:34 -0500 Subject: initial add --- AGENTS.md | 66 +++++++ CLAUDE.md | 66 +++++++ Carbon-and-Signal-preview.html | 413 +++++++++++++++++++++++++++++++++++++++++ HOSTING.md | 51 +++++ README.md | 170 +++++++++++++++++ contrast.md | 78 ++++++++ css/pw-bootstrap.css | 131 +++++++++++++ css/pw-components.css | 61 ++++++ css/pw-fonts.css | 6 + css/pw-tokens.css | 260 ++++++++++++++++++++++++++ css/pw-zensical.css | 51 +++++ examples/index.html | 88 +++++++++ examples/theme.js | 21 +++ favicon.svg | 1 + index.html | 114 ++++++++++++ install.sh | 2 + llms.txt | 20 ++ styleguide.css | 30 +++ styleguide.js | 113 +++++++++++ tokens.json | 83 +++++++++ tools/build_tokens.py | 75 ++++++++ zensical/zensical.toml | 27 +++ 22 files changed, 1927 insertions(+) create mode 100644 AGENTS.md create mode 100644 CLAUDE.md create mode 100644 Carbon-and-Signal-preview.html create mode 100644 HOSTING.md create mode 100644 README.md create mode 100644 contrast.md create mode 100644 css/pw-bootstrap.css create mode 100644 css/pw-components.css create mode 100644 css/pw-fonts.css create mode 100644 css/pw-tokens.css create mode 100644 css/pw-zensical.css create mode 100644 examples/index.html create mode 100644 examples/theme.js create mode 100644 favicon.svg create mode 100644 index.html create mode 100644 install.sh create mode 100644 llms.txt create mode 100644 styleguide.css create mode 100644 styleguide.js create mode 100644 tokens.json create mode 100644 tools/build_tokens.py create mode 100644 zensical/zensical.toml diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..0013c23 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,66 @@ +# Packet Warriors development instructions +Canonical design system: **Carbon & Signal v1.0.0** (2026-11-27). + +Apply when creating or retrofitting user-facing Packet Warriors software, including Firefly Logger, Firefly QSL/SmoothQSL, XLX Observatory, the Packet Warriors website, and Zensical documentation. Use these rules unless the maintainer explicitly changes the design. These instructions do not authorize unrelated logic changes, commits, deployments, or changes to other repositories. + +## First, resolve the authoritative references + +Read the maintainer's hosted styleguide or local copy before styling. In the styleguide root: +- `README.md`: normative design specification and integration instructions. +- `tokens.json`: canonical master and light/dark functional hex values. +- `css/pw-tokens.css`: framework-independent CSS contract, generated from `tools/build_tokens.py`. +- `css/pw-components.css`: opt-in native components. +- `css/pw-bootstrap.css`: Bootstrap 5.3 runtime adapter. +- `css/pw-zensical.css` and `zensical/zensical.toml`: documentation adapter and configuration. +- `css/pw-fonts.css` and `examples/theme.js`: local font and optional theme-manager recipes. +- `Carbon-and-Signal-preview.html`: standalone application specimens; examples are illustrative, not live product logic. +- `contrast.md`: calculated palette checks, not full accessibility certification. + +If the reference files or current application version cannot be read, report that limitation and avoid inventing missing token values. Use the existing CSS and behavior as the migration baseline. Treat the styleguide as a versioned dependency, not a license to overwrite a project. + +## Non-negotiable visual direction + +- Precision industrial, with only a subtle retro-futurist influence. No stock blue-gray AI aesthetic, Google Material, glassmorphism, neon, glossy gradients, ornamental dashboard clutter, huge shadows or oversized pills. +- Brand wordmark: PACKET in actual Signal Red #C12735; WARRIORS in neutral mode-appropriate text. Not coral or pink. Preserve existing owned product artwork unless explicitly asked to redesign it. +- Approved master colors: Carbon #171715, Graphite #2E2E2A, Pewter #B8B5AB, Porcelain #F2EFE9, Signal Red #C12735, Instrument Amber #DAB16B, Jade #50B39A, Copper #C79A80. Bright Signal #D32939 and Deep Signal #861E28 are related red states. +- Default product accent Signal Red. Firefly Logger and QSL use Instrument Amber. Jade is functional (online, positive, successful), never a required branding element. Amber warnings and red errors must have distinct labels, icons or context. Copper is optional. +- Separate master colors from functional tokens. For example, dark links use readable neutral underlined text, not lightened coral; light-mode success uses #186950. Do not use master red for ordinary small dark-mode text. Light red danger text is functional, not a brand color. +- IBM Plex Sans 400/600/700 and IBM Plex Mono 400. Use monospace selectively (callsigns, frequencies, times, identifiers, code). Self-host licensed fonts and icons for offline applications. Do not depend on a CDN. +- Base 16px; dense data 14px; metadata 13px; heading 22/28px; restrained 4px control and 6px panel radii; spacing scale 4/8/12/16/24/32px. Layer canvas → surface → raised; recess input controls. Use a 3px master Signal Red rule and 1px separators, not heavy shadows. +- Respect zoom, system preferences, reduced motion, forced colors, visible focus, mouse and keyboard. Include visible labels and accessible names. Minimum 44px touch targets where appropriate. Maintain independent day and night palettes. + +## Canonical implementation + +Import the versioned token file rather than creating arbitrary colors. Use role tokens everywhere practical: `--pw-canvas`, `--pw-surface`, `--pw-raised`, `--pw-inset`, `--pw-text`, `--pw-muted`, `--pw-border`, `--pw-control-border`, `--pw-focus`, `--pw-link`, `--pw-action`, `--pw-on-action`, `--pw-success`, `--pw-warning`, `--pw-danger`, matching semantic backgrounds. Use RGB aliases for compatible rgba declarations. Product `data-pw-product="firefly"` remaps action aliases; default product is packet. Use explicit theme attributes on the root and keep them consistent. + +Load framework CSS first, then tokens, optional local fonts, the matching adapter, then narrowly scoped app overrides. For Bootstrap 5.3 use `data-bs-theme`, synchronize `data-pw-theme` if both are present, and inspect compiled variants and icons. Bootstrap <=4 requires a separate mapping. For native CSS use `data-pw-theme="light|dark|auto"`; avoid adding a heavy library for appearance alone. Zensical uses default/slate via its native toggle; merge the existing config, set custom colors, load the adapter and tokens, preserve other settings. Do not replace existing theme toggles with duplicate competing managers. + +`tools/build_tokens.py` is the generator. Do not silently edit generated CSS or approved master colors. If the maintainer changes the system, update source, regenerate artifacts and contrast report, rev the version, and document the change. + +## Retrofit checklist + +1. Inspect the actual repository and branch, framework versions, existing style and font assets, color declarations, theme manager, layouts, validation, hotkeys, tab order, data flows, and existing tests. Identify one representative screen to pilot. +2. Map existing roles to the shared token names. Keep current product-specific names and logos where appropriate. Remove obsolete conflicting overrides only as necessary. Prefer CSS-level changes to rewriting markup or logic; refactor templates only where required for design/accessibility. +3. Implement accessible components using the chosen adapter. Preserve current behavior, keyboard shortcuts, labels, API contracts, permissions, routing, configuration, exports, and data formats. Do not change product functionality as part of styling. +4. Validate mode switching, actual content, interaction states, keyboard-only operation, mouse, touch/tablet (768px/1024px/1280px), 200% zoom, high contrast, and no color-only meaning. Run repository tests and build; inspect screenshots in both modes when possible. Note concrete limitations rather than claiming complete validation. +5. Summarize source files changed, tokens/adapter used, compatibility choices, tests run, and anything unresolved. Do not claim production deployment unless explicitly performed. + +### Application-specific invariants + +- **Firefly Logger:** existing keyboard navigation, focus, Enter key, dupe checks, operating workflow, hand-key entry, client updates, scoreboards, exports and disconnected operation are essential. Dark appearance should work at night; avoid bright fields and flashing surfaces. Tablet first, not phone first. +- **Firefly QSL / SmoothQSL:** preserve ADIF ingestion, selection and QSL generation; do not recolor printable card artwork or change generated output; preserve iframe embedding. +- **XLX Observatory:** preserve live SSE updates, table sorting and links, time-zone display, replaceable header logo, config and Go service deployment. Maintain minimal dependencies. +- **Zensical:** preserve nav, config, search, code highlighting, syntax, existing content, and both schemes. Validate against actual installed version. Don't replace documentation engine merely to change appearance. +- **Packet Warriors:** master brand is not Firefly. Use product-specific accents only for appropriate tools. + +## New project checklist + +1. Establish the actual operating workflow and responsive layout before decoration. Default to native CSS or familiar Bootstrap unless a different framework is justified. Do not add a build stack solely for color. +2. Import the canonical CSS tokens and relevant adapter; use shared components and product attribute. Add IBM Plex locally if present. Use real semantics and labels. +3. Build light and dark modes intentionally, support system settings and user choice; persist preference where appropriate. For radio interfaces status uses Jade/amber/red with text, never color alone. +4. Include representative empty, loading, success, failure, pending, disabled, focus, selected and high-contrast states. Prevent placeholder-only labels and hover-exclusive actions. Use consistent table layouts and keyboard order. +5. Test actual application, not just the styleguide mockup. Keep offline resources local for radio tools requiring disconnected operation. Run accessibility checks and contrast verification for newly introduced combinations. + +## Definition of done + +No arbitrary brand colors; both themes coherent; functional statuses recognizable; critical workflows unchanged or implemented; accessible labels and visible focus; no needless dependency changes; tablet and keyboard checks; no unsupported claims of tests or compatibility. If design compliance conflicts with functionality, preserve functionality and ask the maintainer to resolve the design constraint. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..0013c23 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,66 @@ +# Packet Warriors development instructions +Canonical design system: **Carbon & Signal v1.0.0** (2026-11-27). + +Apply when creating or retrofitting user-facing Packet Warriors software, including Firefly Logger, Firefly QSL/SmoothQSL, XLX Observatory, the Packet Warriors website, and Zensical documentation. Use these rules unless the maintainer explicitly changes the design. These instructions do not authorize unrelated logic changes, commits, deployments, or changes to other repositories. + +## First, resolve the authoritative references + +Read the maintainer's hosted styleguide or local copy before styling. In the styleguide root: +- `README.md`: normative design specification and integration instructions. +- `tokens.json`: canonical master and light/dark functional hex values. +- `css/pw-tokens.css`: framework-independent CSS contract, generated from `tools/build_tokens.py`. +- `css/pw-components.css`: opt-in native components. +- `css/pw-bootstrap.css`: Bootstrap 5.3 runtime adapter. +- `css/pw-zensical.css` and `zensical/zensical.toml`: documentation adapter and configuration. +- `css/pw-fonts.css` and `examples/theme.js`: local font and optional theme-manager recipes. +- `Carbon-and-Signal-preview.html`: standalone application specimens; examples are illustrative, not live product logic. +- `contrast.md`: calculated palette checks, not full accessibility certification. + +If the reference files or current application version cannot be read, report that limitation and avoid inventing missing token values. Use the existing CSS and behavior as the migration baseline. Treat the styleguide as a versioned dependency, not a license to overwrite a project. + +## Non-negotiable visual direction + +- Precision industrial, with only a subtle retro-futurist influence. No stock blue-gray AI aesthetic, Google Material, glassmorphism, neon, glossy gradients, ornamental dashboard clutter, huge shadows or oversized pills. +- Brand wordmark: PACKET in actual Signal Red #C12735; WARRIORS in neutral mode-appropriate text. Not coral or pink. Preserve existing owned product artwork unless explicitly asked to redesign it. +- Approved master colors: Carbon #171715, Graphite #2E2E2A, Pewter #B8B5AB, Porcelain #F2EFE9, Signal Red #C12735, Instrument Amber #DAB16B, Jade #50B39A, Copper #C79A80. Bright Signal #D32939 and Deep Signal #861E28 are related red states. +- Default product accent Signal Red. Firefly Logger and QSL use Instrument Amber. Jade is functional (online, positive, successful), never a required branding element. Amber warnings and red errors must have distinct labels, icons or context. Copper is optional. +- Separate master colors from functional tokens. For example, dark links use readable neutral underlined text, not lightened coral; light-mode success uses #186950. Do not use master red for ordinary small dark-mode text. Light red danger text is functional, not a brand color. +- IBM Plex Sans 400/600/700 and IBM Plex Mono 400. Use monospace selectively (callsigns, frequencies, times, identifiers, code). Self-host licensed fonts and icons for offline applications. Do not depend on a CDN. +- Base 16px; dense data 14px; metadata 13px; heading 22/28px; restrained 4px control and 6px panel radii; spacing scale 4/8/12/16/24/32px. Layer canvas → surface → raised; recess input controls. Use a 3px master Signal Red rule and 1px separators, not heavy shadows. +- Respect zoom, system preferences, reduced motion, forced colors, visible focus, mouse and keyboard. Include visible labels and accessible names. Minimum 44px touch targets where appropriate. Maintain independent day and night palettes. + +## Canonical implementation + +Import the versioned token file rather than creating arbitrary colors. Use role tokens everywhere practical: `--pw-canvas`, `--pw-surface`, `--pw-raised`, `--pw-inset`, `--pw-text`, `--pw-muted`, `--pw-border`, `--pw-control-border`, `--pw-focus`, `--pw-link`, `--pw-action`, `--pw-on-action`, `--pw-success`, `--pw-warning`, `--pw-danger`, matching semantic backgrounds. Use RGB aliases for compatible rgba declarations. Product `data-pw-product="firefly"` remaps action aliases; default product is packet. Use explicit theme attributes on the root and keep them consistent. + +Load framework CSS first, then tokens, optional local fonts, the matching adapter, then narrowly scoped app overrides. For Bootstrap 5.3 use `data-bs-theme`, synchronize `data-pw-theme` if both are present, and inspect compiled variants and icons. Bootstrap <=4 requires a separate mapping. For native CSS use `data-pw-theme="light|dark|auto"`; avoid adding a heavy library for appearance alone. Zensical uses default/slate via its native toggle; merge the existing config, set custom colors, load the adapter and tokens, preserve other settings. Do not replace existing theme toggles with duplicate competing managers. + +`tools/build_tokens.py` is the generator. Do not silently edit generated CSS or approved master colors. If the maintainer changes the system, update source, regenerate artifacts and contrast report, rev the version, and document the change. + +## Retrofit checklist + +1. Inspect the actual repository and branch, framework versions, existing style and font assets, color declarations, theme manager, layouts, validation, hotkeys, tab order, data flows, and existing tests. Identify one representative screen to pilot. +2. Map existing roles to the shared token names. Keep current product-specific names and logos where appropriate. Remove obsolete conflicting overrides only as necessary. Prefer CSS-level changes to rewriting markup or logic; refactor templates only where required for design/accessibility. +3. Implement accessible components using the chosen adapter. Preserve current behavior, keyboard shortcuts, labels, API contracts, permissions, routing, configuration, exports, and data formats. Do not change product functionality as part of styling. +4. Validate mode switching, actual content, interaction states, keyboard-only operation, mouse, touch/tablet (768px/1024px/1280px), 200% zoom, high contrast, and no color-only meaning. Run repository tests and build; inspect screenshots in both modes when possible. Note concrete limitations rather than claiming complete validation. +5. Summarize source files changed, tokens/adapter used, compatibility choices, tests run, and anything unresolved. Do not claim production deployment unless explicitly performed. + +### Application-specific invariants + +- **Firefly Logger:** existing keyboard navigation, focus, Enter key, dupe checks, operating workflow, hand-key entry, client updates, scoreboards, exports and disconnected operation are essential. Dark appearance should work at night; avoid bright fields and flashing surfaces. Tablet first, not phone first. +- **Firefly QSL / SmoothQSL:** preserve ADIF ingestion, selection and QSL generation; do not recolor printable card artwork or change generated output; preserve iframe embedding. +- **XLX Observatory:** preserve live SSE updates, table sorting and links, time-zone display, replaceable header logo, config and Go service deployment. Maintain minimal dependencies. +- **Zensical:** preserve nav, config, search, code highlighting, syntax, existing content, and both schemes. Validate against actual installed version. Don't replace documentation engine merely to change appearance. +- **Packet Warriors:** master brand is not Firefly. Use product-specific accents only for appropriate tools. + +## New project checklist + +1. Establish the actual operating workflow and responsive layout before decoration. Default to native CSS or familiar Bootstrap unless a different framework is justified. Do not add a build stack solely for color. +2. Import the canonical CSS tokens and relevant adapter; use shared components and product attribute. Add IBM Plex locally if present. Use real semantics and labels. +3. Build light and dark modes intentionally, support system settings and user choice; persist preference where appropriate. For radio interfaces status uses Jade/amber/red with text, never color alone. +4. Include representative empty, loading, success, failure, pending, disabled, focus, selected and high-contrast states. Prevent placeholder-only labels and hover-exclusive actions. Use consistent table layouts and keyboard order. +5. Test actual application, not just the styleguide mockup. Keep offline resources local for radio tools requiring disconnected operation. Run accessibility checks and contrast verification for newly introduced combinations. + +## Definition of done + +No arbitrary brand colors; both themes coherent; functional statuses recognizable; critical workflows unchanged or implemented; accessible labels and visible focus; no needless dependency changes; tablet and keyboard checks; no unsupported claims of tests or compatibility. If design compliance conflicts with functionality, preserve functionality and ask the maintainer to resolve the design constraint. diff --git a/Carbon-and-Signal-preview.html b/Carbon-and-Signal-preview.html new file mode 100644 index 0000000..fc840d0 --- /dev/null +++ b/Carbon-and-Signal-preview.html @@ -0,0 +1,413 @@ + + + + +Carbon & Signal — Packet Warriors design system + + + + + +
+
PACKETWARRIORS
Design system / 01
+
Precision industrial · Carbon & Signal

Built for
the signal.

Independent engineering for amateur radio. Warm neutrals, deliberate red markings, instrument amber, and Jade for operational feedback.

+
+
Illustrative data · not connected to a radio
+
+
Packet Warriors / Software
XLX OBSERVATORY
Server online
+
+
PACKETWARRIORS
N8EI / Engineering tools
+
+
+
01 / Typography

IBM Plex Sans

Engineering clarity. Human character.

400 body · 600 controls/headings · 700 wordmarks

IBM Plex Mono: N8EI / 145.250 MHz / 18:42:07 UTC
+
02 / Semantic states

Signals, not decoration

ConnectedAttentionFailedIdle
Success: operation complete.
+
+

Carbon & Signal · v1.0 / Local offline specimen · Font uses installed IBM Plex or system fallback

+
+ + diff --git a/HOSTING.md b/HOSTING.md new file mode 100644 index 0000000..33a34c3 --- /dev/null +++ b/HOSTING.md @@ -0,0 +1,51 @@ +# Self-hosting Carbon & Signal + +This is a buildless static site. Extract the supplied ZIP to a directory served by Apache or nginx. All files and paths are relative and there is no application server, database, Node.js, npm, CDN, or build process. + +## Apache + +Copy the archive to the server and extract into a suitable document root or subdirectory, e.g.: + +```sh +sudo install -d -m 0755 /var/www/html/styleguide +sudo unzip packet-warriors-styleguide-v1.0.zip -d /var/www/html/styleguide +``` + +Browse to `https://your-domain.example/styleguide/`. A dedicated virtual host may instead set DocumentRoot to the extraction directory. Set permissions for web server read access. Prefer TLS and disable directory listing. Do not expose credentials or private application configuration in this directory. + +## nginx + +Serve the extracted directory as a normal static root or alias. For a dedicated vhost: + +```nginx +server { + listen 80; + server_name styleguide.example.org; + root /var/www/styleguide; + index index.html; + + location / { + try_files $uri $uri/ =404; + } +} +``` + +Set up HTTPS according to your existing hosting practices. Relative links work on a subpath. The MIME type for CSS/JS/JSON should remain appropriate. + +## Local preview + +Open index.html directly (the site uses embedded token data and local assets), or run: + +```sh +python3 -m http.server 8000 +``` + +Browse to http://localhost:8000/. Clipboard support can vary on file:// or non-HTTPS hosts. + +## Fonts and agent adoption + +This distribution does not bundle IBM Plex font binaries. Place licensed WOFF2 files in fonts/ using the names in css/pw-fonts.css (or adjust the paths). Add a link to css/pw-fonts.css in index.html and the gallery if you want to force local WOFF2 loading; otherwise installed IBM Plex and system fallbacks are used. Retain the original license for redistributed fonts. + +Copy AGENTS.md and CLAUDE.md to each repo root. If the repository already has agent instructions, **merge** the relevant design-system rules rather than replacing operational instructions. Put a link to your hosted styleguide in the agent files. Version and vendor css/pw-tokens.css and the relevant adapter into the repo, rather than requiring an external URL at runtime. Keep critical assets local for offline Firefly operations. Specify the canonical source version in each app README. + +The styleguide is public-facing reference material if you publish it on your server. It contains no production credentials and no live radio data. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c6d07bf --- /dev/null +++ b/README.md @@ -0,0 +1,170 @@ +# Packet Warriors Design System +## Carbon & Signal — v1.0.0 + +**Creative direction:** Precision industrial with restrained retro-futurism. Designed for independent engineering, experimentation, innovation, technical expertise and professionalism. + +This starter kit is intended for Packet Warriors (.com/.net), Firefly Logger, Firefly QSL (SmoothQSL), XLX Observatory, and Zensical documentation. It is not an application rewrite. No repositories or deployed sites were modified. + +## Start here + +1. Open `examples/index.html` in a browser (no server or internet required). Select Light, Dark or System and switch among product specimens. Logger and QSL contain local sample forms. +2. Review `tokens.json` and `contrast.md`. +3. Copy `css/pw-tokens.css` into each application. Load the appropriate adapter or map these tokens to existing CSS. +4. If needed, add your locally hosted IBM Plex fonts using `pw-fonts.css` and the file names below. +5. Migrate one screen at a time, test keyboard paths and tablet layouts, then deploy. + +## 1. Brand identity + +| Name | Hex | Use | +|---|---|---| +| Carbon | #171715 | Dark canvas | +| Graphite | #2E2E2A | Raised structural surfaces | +| Pewter | #B8B5AB | Metallic neutral | +| Porcelain | #F2EFE9 | Light canvas | +| Signal Red | #C12735 | Master brand, rule, solid primary action | +| Bright Signal | #D32939 | Red interaction state | +| Deep Signal | #861E28 | Brand depth | +| Instrument Amber | #DAB16B | Firefly product identity | +| Jade | #50B39A | Connected, positive and successful states | +| Copper | #C79A80 | Optional illustration, secondary data series or small decoration | + +**Wordmark:** PACKET in Signal Red, WARRIORS in the mode's main neutral text color. IBM Plex Sans Bold (700), tightly set, no decorative effects. Brand marks should not be used as ordinary small red links in dark mode. Use full accessible text for logos, accessible button names and distinct focus outlines. Prefer a monochrome wordmark if brand red cannot be used legibly at the intended size. + +**Product architecture:** shared surfaces, typography, shape, interactions and status conventions. Firefly Logger and Firefly QSL use amber for product marks and primary actions. XLX Observatory uses Signal Red (and can retain a reflector's custom logo). Other products default to Signal Red. Jade is a shared semantic accent, not a product brand. Copper is supplemental, not required everywhere. + +**Do not:** introduce tinted blue-gray canvases, glass effects, large drop shadows, neon gradients, oversized pills, decorative gauges, or excessive sci-fi type. Color should describe a state or affordance, not just fill empty space. + +## 2. Practical color tokens + +Roles are defined in `tokens.json` and generated to `css/pw-tokens.css` as `--pw-ROLE` and `--pw-ROLE-rgb` (comma-separated RGB). Edit the source dictionaries in `tools/build_tokens.py`, run `python3 tools/build_tokens.py`, and commit all generated files together. + +| Role | Light | Dark | +|---|---|---| +| canvas | #F2EFE9 | #171715 | +| surface | #FFFCF7 | #22221F | +| raised | #E1DED5 | #2E2E2A | +| inset | #F8F5EF | #141412 | +| text | #272620 | #E8E6DF | +| muted | #615F56 | #ADA99F | +| border (decorative) | #CBC7BD | #484840 | +| control-border | #817D72 | #7A7971 | +| primary | #C12735 | #C12735 | +| on-primary | white | white | +| link | #A52C36 | #D8D4C9 | +| firefly | #8A5D20 | #DAB16B | +| success | #186950 | #50B39A | +| warning | #785018 | #DAB16B | +| danger | #A52C36 | #F1989C | +| focus | #A52C36 | #DAB16B | + +The approved brand colors are immutable within this version. The functional light Jade is darker than the early mockup (#207A62) to improve contrast on raised surfaces and success callouts. Dark-mode ordinary links use underlined neutral text, not pale coral. Reserve light red error text for genuine danger; it is deliberately distinct from the actual deep Signal Red brand and is never the wordmark color. + +Use the paired background token for semantic callouts; do not put ordinary dark-mode body copy on Signal Red. Prefer a dark foreground for dark-mode amber, and white on filled Signal Red. Use text plus symbols for operational conditions. TX/on-air may use Jade plus explicit ON AIR text; do not confuse ongoing radio activity with failure. Warnings use amber only in context; avoid relying on amber alone to distinguish a warning from a normal Firefly action. + +## 3. Typography and geometry + +- IBM Plex Sans: 400 body, 600 headings/controls, 700 branding. IBM Plex Mono: 400 commands, IDs, frequencies, timestamps, optionally call signs. Use monospace selectively. +- Base 16px (1rem), small controls and dense data 14px, secondary metadata 13px, section heading 22px, page heading 28px, marketing headline 36px+; body line height 1.5, headings 1.2. Support user zoom, never lock browser font size. +- Space scale 4, 8, 12, 16, 24, 32px. Use 4px corner radius for controls, 6px panels, full rounding only for status dots. +- Canvas → surface → raised; recessed inputs use inset plus visible control border. Use a 1px separator, 3px red brand rule. Avoid elevation shadows except restrained overlays. +- Typical control height 40px; use at least 44px for coarse-pointer/touch controls. Keep visible labels, do not use placeholders alone. +- Data tables: compact row padding, meaningful labels and scope on header cells, tabular numerals; horizontal scroll if necessary. Avoid gratuitous nested cards. +- Keyboard: maintain existing Tab order, direct shortcuts, Enter submission and autofocus conventions where appropriate. Do not capture keys globally when typing; avoid hover-only actions. Use a visible 2px outline offset 3px. Never remove outlines without a replacement. +- Firefly night operations: predominantly Carbon and muted secondary text; no bright white panels, flashing backgrounds or full-page alerts. Provide consistent light/dark switching and respect OS preferences. Keep full contrast for actionable text. + +## 4. Native application integration (XLX Observatory) + +Load `pw-tokens.css` first, optional `pw-fonts.css`, then `pw-components.css` if using those classes; your existing style overrides should follow. + +```html + + + + + + +
XLX OBSERVATORY
+
+
Reflector status
+
Connected
+
+ + +``` + +If retaining the existing markup, map the old variables to PW roles instead of changing every template. Map canvas, panel, titlebar, text, muted, borders, input, link and statuses first. If old style selectors are more specific, remove conflicting hard-coded colors. Preserve SSE updates, table sorting, replaceable header logos and existing user settings. Use the actual current stylesheet as the integration target; the adapter is not a patch against a known repository revision. + +Set `data-pw-theme` to light/dark/auto on the html element; auto follows the OS. Optional `examples/theme.js` resolves system mode and persists choices; integrate with your existing toggle rather than running two preference managers. `data-pw-product="firefly"` remaps `--pw-action` and related aliases. + +## 5. Bootstrap 5.3 integration (Firefly) + +Load order: existing local Bootstrap 5.3 CSS → pw-tokens.css → optional pw-fonts.css → pw-bootstrap.css → app-specific overrides. Optionally load native components for .pw-* classes. Do not mix two conflicting appearance managers. + +```html + + + + + + + +
+
Log contact
+
+ + + +
+
+ + +``` + +The runtime adapter covers global variables, common buttons, cards, tables, forms, dropdowns, modal, navigation, utility backgrounds and focus. Some Bootstrap styles are precompiled (SVG icons, other variants, table variants, helper classes). Audit those where used; use a Sass build if broad variant coverage is required. Use outlined danger actions rather than ordinary primary red for destructive operations; include a clear destructive label and confirmation when appropriate. Keep data-bs-theme on the root, and if using data-pw-theme as well, keep them synchronized. The included theme.js does that. Bootstrap 4 and older require a separate adapter. + +For Logger, verify tab order and shortcuts on every log-entry workflow, dupe status, invalid input, hand-key, CW/SSB/digital modes and export. For QSL, verify lookup, selected rows, printable card workflow and iframe embedding. Do not recolor QSL card images or change generated print output. + +## 6. Zensical integration + +Use the supplied `zensical/zensical.toml` as a configuration fragment. Merge into the existing config; do not overwrite nav, metadata, or plugin settings. Copy the CSS into docs/stylesheets as listed by extra_css. If using MkDocs YAML, use the equivalent settings (theme.palette list, theme.font: false, extra_css list). Retain default and slate schemes for Zensical's built-in toggle. Set primary and accent to custom for the explicit light/dark entries. The CSS maps both schemes onto the PW role tokens and overrides common success/warning/danger/note admonitions. + +Self-host font files within docs/fonts, relative to docs/stylesheets/pw-fonts.css. In Zensical, font=false disables Google autoloading; the CSS defines --md-text-font and --md-code-font. If using existing local fonts, point the @font-face URLs at those files. Remove stale CSS that overwrites the same --md-* variables, and test both modes including nav, search, code highlighting, admonitions and generated tables. If your custom header uses separate styles, apply the 3px Signal Red rule there. + +This is a starter adapter, not a diagnosis of the broken live theme. It follows the documented selectors, but needs validation against your installed Zensical version and existing overrides. + +## 7. Fonts, offline, and distribution + +The package does not include font binaries or Bootstrap. The standalone gallery uses installed IBM Plex if available, otherwise a system fallback. Add licensed local WOFF2 files with these names (or edit pw-fonts.css): +- IBMPlexSans-Regular.woff2 +- IBMPlexSans-SemiBold.woff2 +- IBMPlexSans-Bold.woff2 +- IBMPlexMono-Regular.woff2 + +Obtain the fonts from IBM's repository (https://github.com/IBM/plex) and include the applicable font license when redistributing. Keep all fonts, CSS, JS and icons local where Firefly must operate without the internet. + +## 8. Acceptance checklist + +- Light/Dark/System appearance correctly follows preference and survives refresh in the actual app. +- Test at 1280px, 1024px and 768px; tablet landscape and portrait; browser zoom to 200%. +- Check operating flows with keyboard only, then touch, and with Windows High Contrast / forced colors. +- Prefer text or icon plus state color; no crucial information conveyed solely via red/green. +- Confirm forms, dropdowns, stateful buttons, invalid inputs, and checkboxes remain visible in both modes. +- Test alerts and labels; avoid clipping focus outlines in scrollable panels. +- Check colors on inexpensive displays in bright light and, for Firefly, at night. +- Preserve live operations and existing configuration; test each application before production release. +- Calculated contrast.md is a palette-level check, not proof of full WCAG conformance. + +## References + +- Bootstrap 5.3 color modes: https://getbootstrap.com/docs/5.3/customize/color-modes/ +- Bootstrap 5.3 color: https://getbootstrap.com/docs/5.3/customize/color/ +- Bootstrap 5.3 buttons: https://getbootstrap.com/docs/5.3/components/buttons/ +- Zensical colors: https://zensical.org/docs/setup/colors/ +- Zensical fonts: https://zensical.org/docs/setup/fonts/ +- IBM Plex: https://github.com/IBM/plex + +Version 1.0.0 · 2026-11-27 + +## Verification status + +The role pairs in contrast.md pass their listed targets. JSON, Zensical TOML, JavaScript syntax and CSS structural checks were completed. Browser-level interactive/visual QA could not be completed because the local Chromium executable was unavailable. The specimen is supplied for your review, not as a tested production application. Neither the Bootstrap adapter nor Zensical configuration has been run against your live projects. Use the acceptance checklist before merging. diff --git a/contrast.md b/contrast.md new file mode 100644 index 0000000..74447a7 --- /dev/null +++ b/contrast.md @@ -0,0 +1,78 @@ +# Contrast checks + +Calculated WCAG relative-luminance contrast ratios for selected token pairs. Normal text target 4.5:1; control borders/focus target 3:1. This is not full accessibility certification. + +| Mode | Foreground | Background | Ratio | Target | Result | +|---|---|---|---:|---:|---| +| light | text | canvas | 13.22:1 | 4.5:1 | PASS | +| light | text | surface | 14.82:1 | 4.5:1 | PASS | +| light | text | raised | 11.28:1 | 4.5:1 | PASS | +| light | muted | canvas | 5.58:1 | 4.5:1 | PASS | +| light | muted | surface | 6.26:1 | 4.5:1 | PASS | +| light | muted | raised | 4.76:1 | 4.5:1 | PASS | +| light | link | canvas | 6.07:1 | 4.5:1 | PASS | +| light | link | surface | 6.81:1 | 4.5:1 | PASS | +| light | link | raised | 5.18:1 | 4.5:1 | PASS | +| light | success | canvas | 5.76:1 | 4.5:1 | PASS | +| light | success | surface | 6.46:1 | 4.5:1 | PASS | +| light | success | raised | 4.92:1 | 4.5:1 | PASS | +| light | warning | canvas | 6.18:1 | 4.5:1 | PASS | +| light | warning | surface | 6.93:1 | 4.5:1 | PASS | +| light | warning | raised | 5.28:1 | 4.5:1 | PASS | +| light | danger | canvas | 6.07:1 | 4.5:1 | PASS | +| light | danger | surface | 6.81:1 | 4.5:1 | PASS | +| light | danger | raised | 5.18:1 | 4.5:1 | PASS | +| light | success | success-bg | 5.48:1 | 4.5:1 | PASS | +| light | warning | warning-bg | 5.67:1 | 4.5:1 | PASS | +| light | danger | danger-bg | 5.36:1 | 4.5:1 | PASS | +| light | info | info-bg | 5.04:1 | 4.5:1 | PASS | +| light | on-primary | primary | 5.82:1 | 4.5:1 | PASS | +| light | on-primary | primary-hover | 7.41:1 | 4.5:1 | PASS | +| light | on-primary | primary-active | 9.42:1 | 4.5:1 | PASS | +| light | on-firefly | firefly | 5.73:1 | 4.5:1 | PASS | +| light | on-firefly | firefly-hover | 7.83:1 | 4.5:1 | PASS | +| light | on-firefly | firefly-active | 10.20:1 | 4.5:1 | PASS | +| light | control-border | canvas | 3.58:1 | 3:1 | PASS | +| light | control-border | surface | 4.02:1 | 3:1 | PASS | +| light | control-border | raised | 3.06:1 | 3:1 | PASS | +| light | control-border | inset | 3.78:1 | 3:1 | PASS | +| light | focus | canvas | 6.07:1 | 3:1 | PASS | +| light | focus | surface | 6.81:1 | 3:1 | PASS | +| light | focus | raised | 5.18:1 | 3:1 | PASS | +| light | focus | inset | 6.40:1 | 3:1 | PASS | +| dark | text | canvas | 14.37:1 | 4.5:1 | PASS | +| dark | text | surface | 12.77:1 | 4.5:1 | PASS | +| dark | text | raised | 10.92:1 | 4.5:1 | PASS | +| dark | muted | canvas | 7.65:1 | 4.5:1 | PASS | +| dark | muted | surface | 6.80:1 | 4.5:1 | PASS | +| dark | muted | raised | 5.81:1 | 4.5:1 | PASS | +| dark | link | canvas | 12.12:1 | 4.5:1 | PASS | +| dark | link | surface | 10.77:1 | 4.5:1 | PASS | +| dark | link | raised | 9.21:1 | 4.5:1 | PASS | +| dark | success | canvas | 7.06:1 | 4.5:1 | PASS | +| dark | success | surface | 6.27:1 | 4.5:1 | PASS | +| dark | success | raised | 5.36:1 | 4.5:1 | PASS | +| dark | warning | canvas | 8.96:1 | 4.5:1 | PASS | +| dark | warning | surface | 7.96:1 | 4.5:1 | PASS | +| dark | warning | raised | 6.80:1 | 4.5:1 | PASS | +| dark | danger | canvas | 8.30:1 | 4.5:1 | PASS | +| dark | danger | surface | 7.38:1 | 4.5:1 | PASS | +| dark | danger | raised | 6.30:1 | 4.5:1 | PASS | +| dark | success | success-bg | 5.29:1 | 4.5:1 | PASS | +| dark | warning | warning-bg | 6.85:1 | 4.5:1 | PASS | +| dark | danger | danger-bg | 6.71:1 | 4.5:1 | PASS | +| dark | info | info-bg | 6.46:1 | 4.5:1 | PASS | +| dark | on-primary | primary | 5.82:1 | 4.5:1 | PASS | +| dark | on-primary | primary-hover | 5.07:1 | 4.5:1 | PASS | +| dark | on-primary | primary-active | 7.12:1 | 4.5:1 | PASS | +| dark | on-firefly | firefly | 8.96:1 | 4.5:1 | PASS | +| dark | on-firefly | firefly-hover | 10.64:1 | 4.5:1 | PASS | +| dark | on-firefly | firefly-active | 6.85:1 | 4.5:1 | PASS | +| dark | control-border | canvas | 4.10:1 | 3:1 | PASS | +| dark | control-border | surface | 3.65:1 | 3:1 | PASS | +| dark | control-border | raised | 3.12:1 | 3:1 | PASS | +| dark | control-border | inset | 4.22:1 | 3:1 | PASS | +| dark | focus | canvas | 8.96:1 | 3:1 | PASS | +| dark | focus | surface | 7.96:1 | 3:1 | PASS | +| dark | focus | raised | 6.80:1 | 3:1 | PASS | +| dark | focus | inset | 9.21:1 | 3:1 | PASS | diff --git a/css/pw-bootstrap.css b/css/pw-bootstrap.css new file mode 100644 index 0000000..66f40fe --- /dev/null +++ b/css/pw-bootstrap.css @@ -0,0 +1,131 @@ +/* Bootstrap 5.3 runtime adapter. Load bootstrap.min.css first, then tokens, then this. + Put data-bs-theme and data-pw-product on the same root element. */ +:root, [data-bs-theme=light], [data-bs-theme=dark] { + --bs-font-sans-serif:var(--pw-font); + --bs-font-monospace:var(--pw-mono); + --bs-body-font-family:var(--pw-font); + --bs-body-color:var(--pw-text); + --bs-body-color-rgb:var(--pw-text-rgb); + --bs-body-bg:var(--pw-canvas); + --bs-body-bg-rgb:var(--pw-canvas-rgb); + --bs-emphasis-color:var(--pw-text); + --bs-emphasis-color-rgb:var(--pw-text-rgb); + --bs-secondary-color:var(--pw-muted); + --bs-secondary-color-rgb:var(--pw-muted-rgb); + --bs-secondary-bg:var(--pw-surface); + --bs-secondary-bg-rgb:var(--pw-surface-rgb); + --bs-tertiary-color:var(--pw-muted); + --bs-tertiary-color-rgb:var(--pw-muted-rgb); + --bs-tertiary-bg:var(--pw-raised); + --bs-tertiary-bg-rgb:var(--pw-raised-rgb); + --bs-border-color:var(--pw-border); + --bs-border-color-translucent:rgba(var(--pw-border-rgb), .8); + --bs-border-radius:var(--pw-radius); + --bs-border-radius-sm:var(--pw-radius); + --bs-border-radius-lg:var(--pw-radius-panel); + --bs-border-radius-xl:var(--pw-radius-panel); + --bs-link-color:var(--pw-link); + --bs-link-color-rgb:var(--pw-link-rgb); + --bs-link-hover-color:var(--pw-link); + --bs-link-hover-color-rgb:var(--pw-link-rgb); + --bs-primary:var(--pw-action); + --bs-primary-rgb:var(--pw-action-rgb); + --bs-success:var(--pw-success); + --bs-success-rgb:var(--pw-success-rgb); + --bs-warning:var(--pw-warning); + --bs-warning-rgb:var(--pw-warning-rgb); + --bs-danger:var(--pw-danger); + --bs-danger-rgb:var(--pw-danger-rgb); + --bs-info:var(--pw-info); + --bs-info-rgb:var(--pw-info-rgb); + --bs-secondary:var(--pw-muted); + --bs-secondary-rgb:var(--pw-muted-rgb); + --bs-primary-text-emphasis:var(--pw-link); + --bs-primary-bg-subtle:var(--pw-selection); + --bs-primary-border-subtle:var(--pw-control-border); + --bs-success-text-emphasis:var(--pw-success); + --bs-success-bg-subtle:var(--pw-success-bg); + --bs-success-border-subtle:var(--pw-success); + --bs-warning-text-emphasis:var(--pw-warning); + --bs-warning-bg-subtle:var(--pw-warning-bg); + --bs-warning-border-subtle:var(--pw-warning); + --bs-danger-text-emphasis:var(--pw-danger); + --bs-danger-bg-subtle:var(--pw-danger-bg); + --bs-danger-border-subtle:var(--pw-danger); + --bs-info-text-emphasis:var(--pw-info); + --bs-info-bg-subtle:var(--pw-info-bg); + --bs-info-border-subtle:var(--pw-info); + --bs-secondary-text-emphasis:var(--pw-muted); + --bs-secondary-bg-subtle:var(--pw-raised); + --bs-secondary-border-subtle:var(--pw-control-border); + --bs-code-color:var(--pw-text); + --bs-focus-ring-color:rgba(var(--pw-focus-rgb),.55); +} +.btn-primary { + --bs-btn-color:var(--pw-on-action); --bs-btn-bg:var(--pw-action); --bs-btn-border-color:var(--pw-action); + --bs-btn-hover-color:var(--pw-on-action); --bs-btn-hover-bg:var(--pw-action-hover); --bs-btn-hover-border-color:var(--pw-action-hover); + --bs-btn-active-color:var(--pw-on-action); --bs-btn-active-bg:var(--pw-action-active); --bs-btn-active-border-color:var(--pw-action-active); + --bs-btn-disabled-color:var(--pw-disabled); --bs-btn-disabled-bg:var(--pw-disabled-bg); --bs-btn-disabled-border-color:var(--pw-border); + --bs-btn-focus-shadow-rgb:var(--pw-focus-rgb); +} +.btn-outline-primary,.btn-secondary,.btn-outline-secondary { + --bs-btn-color:var(--pw-text); --bs-btn-bg:var(--pw-surface); --bs-btn-border-color:var(--pw-control-border); + --bs-btn-hover-color:var(--pw-text); --bs-btn-hover-bg:var(--pw-hover); --bs-btn-hover-border-color:var(--pw-control-border); + --bs-btn-active-color:var(--pw-text); --bs-btn-active-bg:var(--pw-raised); --bs-btn-active-border-color:var(--pw-control-border); + --bs-btn-disabled-color:var(--pw-disabled); --bs-btn-disabled-bg:var(--pw-disabled-bg); --bs-btn-disabled-border-color:var(--pw-border); +} +.btn-outline-danger { + --bs-btn-color:var(--pw-danger); --bs-btn-border-color:var(--pw-danger); + --bs-btn-hover-color:var(--pw-danger); --bs-btn-hover-bg:var(--pw-danger-bg); --bs-btn-hover-border-color:var(--pw-danger); + --bs-btn-active-color:var(--pw-danger); --bs-btn-active-bg:var(--pw-danger-bg); --bs-btn-active-border-color:var(--pw-danger); +} +.btn { font-weight:600; border-radius:var(--pw-radius); min-height:var(--pw-control-height); } +.card { --bs-card-bg:var(--pw-surface); --bs-card-border-color:var(--pw-border); --bs-card-border-radius:var(--pw-radius-panel); --bs-card-cap-bg:var(--pw-raised); --bs-card-color:var(--pw-text); } +.table { + --bs-table-color:var(--pw-text); --bs-table-bg:var(--pw-surface); --bs-table-border-color:var(--pw-border); + --bs-table-striped-color:var(--pw-text); --bs-table-striped-bg:var(--pw-canvas); + --bs-table-hover-color:var(--pw-text); --bs-table-hover-bg:var(--pw-hover); + --bs-table-active-color:var(--pw-on-selection); --bs-table-active-bg:var(--pw-selection); +} +.table thead th { background:var(--pw-raised); color:var(--pw-text); } +.form-control,.form-select { background-color:var(--pw-inset); color:var(--pw-text); border-color:var(--pw-control-border); min-height:var(--pw-control-height); } +.form-control::placeholder { color:var(--pw-muted); opacity:1; } +.form-control:focus,.form-select:focus { background-color:var(--pw-inset); color:var(--pw-text); border-color:var(--pw-focus); box-shadow:none; } +.form-check-input { border-color:var(--pw-control-border); } +.form-check-input:checked { background-color:var(--pw-action); border-color:var(--pw-action); } +/* The compiled default check graphic is white; ensure it stays legible on amber. */ +[data-pw-product=firefly] .form-check-input:checked { background-color:var(--pw-brand-signal); border-color:var(--pw-brand-signal); } +:focus-visible { outline:2px solid var(--pw-focus)!important; outline-offset:3px; } +.dropdown-menu { --bs-dropdown-bg:var(--pw-surface); --bs-dropdown-border-color:var(--pw-border); --bs-dropdown-link-color:var(--pw-text); --bs-dropdown-link-hover-color:var(--pw-text); --bs-dropdown-link-hover-bg:var(--pw-hover); --bs-dropdown-link-active-color:var(--pw-on-selection); --bs-dropdown-link-active-bg:var(--pw-selection); } +.modal { --bs-modal-bg:var(--pw-surface); --bs-modal-color:var(--pw-text); --bs-modal-border-color:var(--pw-border); --bs-modal-header-border-color:var(--pw-border); --bs-modal-footer-border-color:var(--pw-border); } +.nav-tabs { --bs-nav-tabs-border-color:var(--pw-border); --bs-nav-tabs-link-active-color:var(--pw-text); --bs-nav-tabs-link-active-bg:var(--pw-surface); --bs-nav-tabs-link-active-border-color:var(--pw-border) var(--pw-border) var(--pw-surface); } +.nav-pills { --bs-nav-pills-link-active-color:var(--pw-on-action); --bs-nav-pills-link-active-bg:var(--pw-action); } +.text-bg-primary { color:var(--pw-on-action)!important; } +.text-bg-success,.text-bg-warning,.text-bg-danger,.text-bg-info { color:var(--pw-canvas)!important; } +@media(pointer:coarse){ .btn,.form-control,.form-select { min-height:44px; } } +@media(forced-colors:active){ :focus-visible { outline-color:Highlight!important; } .btn,.form-control,.form-select { border:1px solid ButtonText; } } +[data-bs-theme=light] .text-bg-success,[data-bs-theme=light] .text-bg-warning,[data-bs-theme=light] .text-bg-danger,[data-bs-theme=light] .text-bg-info { color:#fff!important; } +/* Dark red is a graphic/filled-control accent; use readable neutral link text. */ +[data-bs-theme=dark] .text-primary { color:var(--pw-link)!important; } +.btn-success { + --bs-btn-color:var(--pw-canvas); --bs-btn-bg:var(--pw-success); --bs-btn-border-color:var(--pw-success); + --bs-btn-hover-color:var(--pw-success); --bs-btn-hover-bg:var(--pw-success-bg); --bs-btn-hover-border-color:var(--pw-success); + --bs-btn-active-color:var(--pw-success); --bs-btn-active-bg:var(--pw-success-bg); --bs-btn-active-border-color:var(--pw-success); +} +.btn-warning { + --bs-btn-color:var(--pw-canvas); --bs-btn-bg:var(--pw-warning); --bs-btn-border-color:var(--pw-warning); + --bs-btn-hover-color:var(--pw-warning); --bs-btn-hover-bg:var(--pw-warning-bg); --bs-btn-hover-border-color:var(--pw-warning); + --bs-btn-active-color:var(--pw-warning); --bs-btn-active-bg:var(--pw-warning-bg); --bs-btn-active-border-color:var(--pw-warning); +} +.btn-danger { + --bs-btn-color:var(--pw-danger); --bs-btn-bg:var(--pw-danger-bg); --bs-btn-border-color:var(--pw-danger); + --bs-btn-hover-color:var(--pw-text); --bs-btn-hover-bg:var(--pw-danger-bg); --bs-btn-hover-border-color:var(--pw-danger); + --bs-btn-active-color:var(--pw-text); --bs-btn-active-bg:var(--pw-danger-bg); --bs-btn-active-border-color:var(--pw-danger); +} +.btn-info { + --bs-btn-color:var(--pw-text); --bs-btn-bg:var(--pw-info-bg); --bs-btn-border-color:var(--pw-control-border); + --bs-btn-hover-color:var(--pw-text); --bs-btn-hover-bg:var(--pw-hover); --bs-btn-hover-border-color:var(--pw-control-border); + --bs-btn-active-color:var(--pw-text); --bs-btn-active-bg:var(--pw-raised); --bs-btn-active-border-color:var(--pw-control-border); +} +[data-bs-theme=light] .btn-success,[data-bs-theme=light] .btn-warning { --bs-btn-color:#fff; } +.btn-primary { --bs-btn-border-color:var(--pw-control-border); --bs-btn-hover-border-color:var(--pw-control-border); --bs-btn-active-border-color:var(--pw-control-border); } diff --git a/css/pw-components.css b/css/pw-components.css new file mode 100644 index 0000000..3bcd34b --- /dev/null +++ b/css/pw-components.css @@ -0,0 +1,61 @@ +/* Native, opt-in components. Load after pw-tokens.css. */ +.pw-app { margin:0; background:var(--pw-canvas); color:var(--pw-text); font:400 var(--pw-size-base)/1.5 var(--pw-font); } +.pw-app *, .pw-app *::before, .pw-app *::after { box-sizing:border-box; } +.pw-app h1,.pw-app h2,.pw-app h3 { line-height:1.2; font-weight:600; margin:0 0 var(--pw-space-3); } +.pw-app h1 { font-size:var(--pw-size-2xl); } +.pw-app h2 { font-size:var(--pw-size-xl); } +.pw-app h3 { font-size:var(--pw-size-lg); } +.pw-app a { color:var(--pw-link); text-underline-offset:.2em; } +.pw-app :focus-visible { outline:var(--pw-focus-width) solid var(--pw-focus); outline-offset:3px; } +.pw-app ::selection { background:var(--pw-selection); color:var(--pw-on-selection); } +.pw-muted { color:var(--pw-muted); } +.pw-mono,.pw-app code,.pw-app pre { font-family:var(--pw-mono); font-variant-numeric:tabular-nums; } +.pw-numeric { font-variant-numeric:tabular-nums; } +.pw-header { background:var(--pw-surface); border-bottom:3px solid var(--pw-brand-signal); padding:var(--pw-space-4) var(--pw-space-5); } +.pw-wordmark { font-weight:700; letter-spacing:-.035em; font-size:var(--pw-size-xl); line-height:1.1; color:var(--pw-text); } +.pw-wordmark span { color:var(--pw-brand-signal); } +/* Graphic wordmark only; text links use the contrast-tested link token. */ +.pw-product-mark { color:var(--pw-product-mark); font-weight:700; } +.pw-panel { background:var(--pw-surface); border:1px solid var(--pw-border); border-radius:var(--pw-radius-panel); } +.pw-panel-title { background:var(--pw-raised); padding:var(--pw-space-3) var(--pw-space-4); border-bottom:1px solid var(--pw-border); border-radius:var(--pw-radius-panel) var(--pw-radius-panel) 0 0; font-weight:600; } +.pw-panel-body { padding:var(--pw-space-4); } +.pw-btn { font:600 var(--pw-size-sm)/1.2 var(--pw-font); min-height:var(--pw-control-height); display:inline-flex; align-items:center; justify-content:center; gap:.5rem; padding:.55rem 1rem; color:var(--pw-text); background:var(--pw-surface); border:1px solid var(--pw-control-border); border-radius:var(--pw-radius); cursor:pointer; } +.pw-btn:hover { background:var(--pw-hover); } +.pw-btn:active { background:var(--pw-raised); } +.pw-btn-primary { background:var(--pw-action); color:var(--pw-on-action); border-color:var(--pw-action); } +.pw-btn-primary:hover { background:var(--pw-action-hover); border-color:var(--pw-action-hover); } +.pw-btn-primary:active { background:var(--pw-action-active); border-color:var(--pw-action-active); } +.pw-btn-danger { color:var(--pw-danger); border-color:var(--pw-danger); } +.pw-btn-danger:hover { background:var(--pw-danger-bg); } +.pw-btn:disabled,.pw-input:disabled { color:var(--pw-disabled); background:var(--pw-disabled-bg); border-color:var(--pw-border); cursor:not-allowed; } +.pw-label { display:block; font-weight:600; font-size:var(--pw-size-sm); margin-bottom:.3rem; } +.pw-input { width:100%; min-height:var(--pw-control-height); padding:.5rem .65rem; font:inherit; color:var(--pw-text); background:var(--pw-inset); border:1px solid var(--pw-control-border); border-radius:var(--pw-radius); } +.pw-input::placeholder { color:var(--pw-muted); opacity:1; } +.pw-input[aria-invalid=true] { border-color:var(--pw-danger); } +.pw-status { display:inline-flex; align-items:center; gap:.45rem; font-size:var(--pw-size-sm); font-weight:600; color:var(--pw-status-color,var(--pw-info)); } +.pw-status::before { content:""; width:.5rem; height:.5rem; border-radius:50%; background:currentColor; flex:none; } +.pw-success { --pw-status-color:var(--pw-success); --pw-status-bg:var(--pw-success-bg); } +.pw-warning { --pw-status-color:var(--pw-warning); --pw-status-bg:var(--pw-warning-bg); } +.pw-danger { --pw-status-color:var(--pw-danger); --pw-status-bg:var(--pw-danger-bg); } +.pw-info { --pw-status-color:var(--pw-info); --pw-status-bg:var(--pw-info-bg); } +.pw-inactive { --pw-status-color:var(--pw-inactive); --pw-status-bg:var(--pw-info-bg); } +.pw-alert { border-inline-start:3px solid var(--pw-status-color,var(--pw-info)); background:var(--pw-status-bg,var(--pw-info-bg)); border-radius:var(--pw-radius); padding:.75rem 1rem; color:var(--pw-text); } +.pw-alert strong { color:var(--pw-status-color,var(--pw-info)); } +.pw-table-wrap { overflow-x:auto; } +.pw-table { width:100%; border-collapse:collapse; text-align:left; font-size:var(--pw-size-sm); } +.pw-table th,.pw-table td { padding:.65rem .85rem; border-bottom:1px solid var(--pw-border); } +.pw-table th { background:var(--pw-raised); color:var(--pw-text); font-weight:600; white-space:nowrap; } +.pw-table tbody tr:nth-child(even) { background:var(--pw-canvas); } +.pw-table tbody tr:hover { background:var(--pw-hover); } +.pw-table tbody tr[aria-selected=true] { color:var(--pw-on-selection); background:var(--pw-selection); } +.pw-nav { display:flex; flex-wrap:wrap; gap:1.25rem; border-bottom:1px solid var(--pw-border); } +.pw-nav a { padding:.65rem .15rem; text-decoration:none; color:var(--pw-muted); border-bottom:2px solid transparent; } +.pw-nav a[aria-current=page] { color:var(--pw-text); border-bottom-color:var(--pw-action); font-weight:600; } +@media (pointer:coarse) { .pw-btn,.pw-input { min-height:44px; } .pw-table td { padding-block:.85rem; } } +@media (forced-colors:active) { + .pw-app :focus-visible { outline:2px solid Highlight; } + .pw-btn,.pw-input,.pw-panel,.pw-alert { border:1px solid ButtonText; } + .pw-status::before { background:CanvasText; } + .pw-nav a[aria-current=page] { border-color:Highlight; } +} +.pw-btn-primary,.pw-btn-primary:hover,.pw-btn-primary:active { border-color:var(--pw-control-border); } diff --git a/css/pw-fonts.css b/css/pw-fonts.css new file mode 100644 index 0000000..f355993 --- /dev/null +++ b/css/pw-fonts.css @@ -0,0 +1,6 @@ +/* Optional: place licensed local WOFF2 files in ../fonts/; no CDN needed. + Use static faces with their actual weight range (do not label static files variable). */ +@font-face { font-family:"IBM Plex Sans"; src:local("IBM Plex Sans Regular"),url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight:400; font-display:swap; } +@font-face { font-family:"IBM Plex Sans"; src:local("IBM Plex Sans SemiBold"),url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight:600; font-display:swap; } +@font-face { font-family:"IBM Plex Sans"; src:local("IBM Plex Sans Bold"),url("../fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight:700; font-display:swap; } +@font-face { font-family:"IBM Plex Mono"; src:local("IBM Plex Mono Regular"),url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight:400; font-display:swap; } diff --git a/css/pw-tokens.css b/css/pw-tokens.css new file mode 100644 index 0000000..067b994 --- /dev/null +++ b/css/pw-tokens.css @@ -0,0 +1,260 @@ +/* Packet Warriors / Carbon & Signal v1.0. Framework-independent tokens. */ +:root { + --pw-brand-carbon: #171715; + --pw-brand-carbon-rgb: 23, 23, 21; + --pw-brand-graphite: #2E2E2A; + --pw-brand-graphite-rgb: 46, 46, 42; + --pw-brand-pewter: #B8B5AB; + --pw-brand-pewter-rgb: 184, 181, 171; + --pw-brand-porcelain: #F2EFE9; + --pw-brand-porcelain-rgb: 242, 239, 233; + --pw-brand-signal: #C12735; + --pw-brand-signal-rgb: 193, 39, 53; + --pw-brand-signal-bright: #D32939; + --pw-brand-signal-bright-rgb: 211, 41, 57; + --pw-brand-signal-deep: #861E28; + --pw-brand-signal-deep-rgb: 134, 30, 40; + --pw-brand-amber: #DAB16B; + --pw-brand-amber-rgb: 218, 177, 107; + --pw-brand-jade: #50B39A; + --pw-brand-jade-rgb: 80, 179, 154; + --pw-brand-copper: #C79A80; + --pw-brand-copper-rgb: 199, 154, 128; + --pw-font: "IBM Plex Sans", system-ui, sans-serif; + --pw-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; + --pw-size-xs: .8125rem; + --pw-size-sm: .875rem; + --pw-size-base: 1rem; + --pw-size-lg: 1.125rem; + --pw-size-xl: 1.375rem; + --pw-size-2xl: 1.75rem; + --pw-size-3xl: 2.25rem; + --pw-space-1: .25rem; + --pw-space-2: .5rem; + --pw-space-3: .75rem; + --pw-space-4: 1rem; + --pw-space-5: 1.5rem; + --pw-space-6: 2rem; + --pw-radius: 4px; + --pw-radius-panel: 6px; + --pw-control-height: 2.5rem; + --pw-focus-width: 2px; + --pw-action: var(--pw-primary); + --pw-on-action: var(--pw-on-primary); + --pw-action-hover: var(--pw-primary-hover); + --pw-action-active: var(--pw-primary-active); + --pw-action-rgb: var(--pw-primary-rgb); + --pw-product-mark: var(--pw-brand-signal); +} +:root, [data-pw-theme="light"], [data-bs-theme="light"], [data-md-color-scheme="default"] { + color-scheme: light; + --pw-canvas: #F2EFE9; + --pw-canvas-rgb: 242, 239, 233; + --pw-surface: #FFFCF7; + --pw-surface-rgb: 255, 252, 247; + --pw-raised: #E1DED5; + --pw-raised-rgb: 225, 222, 213; + --pw-inset: #F8F5EF; + --pw-inset-rgb: 248, 245, 239; + --pw-text: #272620; + --pw-text-rgb: 39, 38, 32; + --pw-muted: #615F56; + --pw-muted-rgb: 97, 95, 86; + --pw-border: #CBC7BD; + --pw-border-rgb: 203, 199, 189; + --pw-control-border: #817D72; + --pw-control-border-rgb: 129, 125, 114; + --pw-focus: #A52C36; + --pw-focus-rgb: 165, 44, 54; + --pw-link: #A52C36; + --pw-link-rgb: 165, 44, 54; + --pw-primary: #C12735; + --pw-primary-rgb: 193, 39, 53; + --pw-on-primary: #FFFFFF; + --pw-on-primary-rgb: 255, 255, 255; + --pw-primary-hover: #A51F2C; + --pw-primary-hover-rgb: 165, 31, 44; + --pw-primary-active: #861E28; + --pw-primary-active-rgb: 134, 30, 40; + --pw-firefly: #8A5D20; + --pw-firefly-rgb: 138, 93, 32; + --pw-on-firefly: #FFFFFF; + --pw-on-firefly-rgb: 255, 255, 255; + --pw-firefly-hover: #704A17; + --pw-firefly-hover-rgb: 112, 74, 23; + --pw-firefly-active: #593B13; + --pw-firefly-active-rgb: 89, 59, 19; + --pw-success: #186950; + --pw-success-rgb: 24, 105, 80; + --pw-success-bg: #DFEDE6; + --pw-success-bg-rgb: 223, 237, 230; + --pw-warning: #785018; + --pw-warning-rgb: 120, 80, 24; + --pw-warning-bg: #EEE5D3; + --pw-warning-bg-rgb: 238, 229, 211; + --pw-danger: #A52C36; + --pw-danger-rgb: 165, 44, 54; + --pw-danger-bg: #F2DDDD; + --pw-danger-bg-rgb: 242, 221, 221; + --pw-info: #615F56; + --pw-info-rgb: 97, 95, 86; + --pw-info-bg: #E7E4DC; + --pw-info-bg-rgb: 231, 228, 220; + --pw-inactive: #615F56; + --pw-inactive-rgb: 97, 95, 86; + --pw-selection: #EFD8D7; + --pw-selection-rgb: 239, 216, 215; + --pw-on-selection: #272620; + --pw-on-selection-rgb: 39, 38, 32; + --pw-hover: #EEEAE1; + --pw-hover-rgb: 238, 234, 225; + --pw-disabled: #77736A; + --pw-disabled-rgb: 119, 115, 106; + --pw-disabled-bg: #E7E3DA; + --pw-disabled-bg-rgb: 231, 227, 218; +} +[data-pw-theme="dark"], [data-bs-theme="dark"], [data-md-color-scheme="slate"] { + color-scheme: dark; + --pw-canvas: #171715; + --pw-canvas-rgb: 23, 23, 21; + --pw-surface: #22221F; + --pw-surface-rgb: 34, 34, 31; + --pw-raised: #2E2E2A; + --pw-raised-rgb: 46, 46, 42; + --pw-inset: #141412; + --pw-inset-rgb: 20, 20, 18; + --pw-text: #E8E6DF; + --pw-text-rgb: 232, 230, 223; + --pw-muted: #ADA99F; + --pw-muted-rgb: 173, 169, 159; + --pw-border: #484840; + --pw-border-rgb: 72, 72, 64; + --pw-control-border: #7A7971; + --pw-control-border-rgb: 122, 121, 113; + --pw-focus: #DAB16B; + --pw-focus-rgb: 218, 177, 107; + --pw-link: #D8D4C9; + --pw-link-rgb: 216, 212, 201; + --pw-primary: #C12735; + --pw-primary-rgb: 193, 39, 53; + --pw-on-primary: #FFFFFF; + --pw-on-primary-rgb: 255, 255, 255; + --pw-primary-hover: #D32939; + --pw-primary-hover-rgb: 211, 41, 57; + --pw-primary-active: #A82330; + --pw-primary-active-rgb: 168, 35, 48; + --pw-firefly: #DAB16B; + --pw-firefly-rgb: 218, 177, 107; + --pw-on-firefly: #171715; + --pw-on-firefly-rgb: 23, 23, 21; + --pw-firefly-hover: #E6C28A; + --pw-firefly-hover-rgb: 230, 194, 138; + --pw-firefly-active: #C39955; + --pw-firefly-active-rgb: 195, 153, 85; + --pw-success: #50B39A; + --pw-success-rgb: 80, 179, 154; + --pw-success-bg: #1C332D; + --pw-success-bg-rgb: 28, 51, 45; + --pw-warning: #DAB16B; + --pw-warning-rgb: 218, 177, 107; + --pw-warning-bg: #352C1D; + --pw-warning-bg-rgb: 53, 44, 29; + --pw-danger: #F1989C; + --pw-danger-rgb: 241, 152, 156; + --pw-danger-bg: #3C2225; + --pw-danger-bg-rgb: 60, 34, 37; + --pw-info: #B8B5AB; + --pw-info-rgb: 184, 181, 171; + --pw-info-bg: #30302C; + --pw-info-bg-rgb: 48, 48, 44; + --pw-inactive: #ADA99F; + --pw-inactive-rgb: 173, 169, 159; + --pw-selection: #48272A; + --pw-selection-rgb: 72, 39, 42; + --pw-on-selection: #E8E6DF; + --pw-on-selection-rgb: 232, 230, 223; + --pw-hover: #30302C; + --pw-hover-rgb: 48, 48, 44; + --pw-disabled: #918E85; + --pw-disabled-rgb: 145, 142, 133; + --pw-disabled-bg: #30302C; + --pw-disabled-bg-rgb: 48, 48, 44; +} +@media (prefers-color-scheme: dark) { +:root:not([data-pw-theme]):not([data-bs-theme]):not([data-md-color-scheme]), [data-pw-theme="auto"] { + color-scheme: dark; + --pw-canvas: #171715; + --pw-canvas-rgb: 23, 23, 21; + --pw-surface: #22221F; + --pw-surface-rgb: 34, 34, 31; + --pw-raised: #2E2E2A; + --pw-raised-rgb: 46, 46, 42; + --pw-inset: #141412; + --pw-inset-rgb: 20, 20, 18; + --pw-text: #E8E6DF; + --pw-text-rgb: 232, 230, 223; + --pw-muted: #ADA99F; + --pw-muted-rgb: 173, 169, 159; + --pw-border: #484840; + --pw-border-rgb: 72, 72, 64; + --pw-control-border: #7A7971; + --pw-control-border-rgb: 122, 121, 113; + --pw-focus: #DAB16B; + --pw-focus-rgb: 218, 177, 107; + --pw-link: #D8D4C9; + --pw-link-rgb: 216, 212, 201; + --pw-primary: #C12735; + --pw-primary-rgb: 193, 39, 53; + --pw-on-primary: #FFFFFF; + --pw-on-primary-rgb: 255, 255, 255; + --pw-primary-hover: #D32939; + --pw-primary-hover-rgb: 211, 41, 57; + --pw-primary-active: #A82330; + --pw-primary-active-rgb: 168, 35, 48; + --pw-firefly: #DAB16B; + --pw-firefly-rgb: 218, 177, 107; + --pw-on-firefly: #171715; + --pw-on-firefly-rgb: 23, 23, 21; + --pw-firefly-hover: #E6C28A; + --pw-firefly-hover-rgb: 230, 194, 138; + --pw-firefly-active: #C39955; + --pw-firefly-active-rgb: 195, 153, 85; + --pw-success: #50B39A; + --pw-success-rgb: 80, 179, 154; + --pw-success-bg: #1C332D; + --pw-success-bg-rgb: 28, 51, 45; + --pw-warning: #DAB16B; + --pw-warning-rgb: 218, 177, 107; + --pw-warning-bg: #352C1D; + --pw-warning-bg-rgb: 53, 44, 29; + --pw-danger: #F1989C; + --pw-danger-rgb: 241, 152, 156; + --pw-danger-bg: #3C2225; + --pw-danger-bg-rgb: 60, 34, 37; + --pw-info: #B8B5AB; + --pw-info-rgb: 184, 181, 171; + --pw-info-bg: #30302C; + --pw-info-bg-rgb: 48, 48, 44; + --pw-inactive: #ADA99F; + --pw-inactive-rgb: 173, 169, 159; + --pw-selection: #48272A; + --pw-selection-rgb: 72, 39, 42; + --pw-on-selection: #E8E6DF; + --pw-on-selection-rgb: 232, 230, 223; + --pw-hover: #30302C; + --pw-hover-rgb: 48, 48, 44; + --pw-disabled: #918E85; + --pw-disabled-rgb: 145, 142, 133; + --pw-disabled-bg: #30302C; + --pw-disabled-bg-rgb: 48, 48, 44; +} +} + +[data-pw-product="firefly"] { + --pw-action: var(--pw-firefly); + --pw-on-action: var(--pw-on-firefly); + --pw-action-hover: var(--pw-firefly-hover); + --pw-action-active: var(--pw-firefly-active); + --pw-action-rgb: var(--pw-firefly-rgb); + --pw-product-mark: var(--pw-firefly); +} diff --git a/css/pw-zensical.css b/css/pw-zensical.css new file mode 100644 index 0000000..779be6b --- /dev/null +++ b/css/pw-zensical.css @@ -0,0 +1,51 @@ +/* Zensical: load after pw-tokens.css. Keep default/slate schemes for native toggle. */ +:root { --md-text-font:"IBM Plex Sans"; --md-code-font:"IBM Plex Mono"; } +[data-md-color-scheme="default"], [data-md-color-scheme="slate"] { + --md-default-bg-color:var(--pw-canvas); + --md-default-bg-color--light:var(--pw-surface); + --md-default-bg-color--lighter:var(--pw-raised); + --md-default-bg-color--lightest:var(--pw-inset); + --md-default-fg-color:var(--pw-text); + --md-default-fg-color--light:var(--pw-muted); + --md-default-fg-color--lighter:var(--pw-control-border); + --md-default-fg-color--lightest:var(--pw-border); + --md-primary-fg-color:var(--pw-surface); + --md-primary-fg-color--light:var(--pw-raised); + --md-primary-fg-color--dark:var(--pw-inset); + --md-primary-bg-color:var(--pw-text); + --md-primary-bg-color--light:var(--pw-muted); + --md-accent-fg-color:var(--pw-link); + --md-accent-fg-color--transparent:var(--pw-selection); + --md-accent-bg-color:var(--pw-text); + --md-typeset-color:var(--pw-text); + --md-typeset-a-color:var(--pw-link); + --md-code-fg-color:var(--pw-text); + --md-code-bg-color:var(--pw-inset); + --md-code-hl-color:var(--pw-selection); + --md-footer-bg-color:var(--pw-surface); + --md-footer-bg-color--dark:var(--pw-raised); + --md-footer-fg-color:var(--pw-text); + --md-footer-fg-color--light:var(--pw-muted); + --md-footer-fg-color--lighter:var(--pw-muted); + --md-admonition-fg-color:var(--pw-text); + --md-admonition-bg-color:var(--pw-surface); +} +.md-header { border-bottom:3px solid var(--pw-brand-signal); box-shadow:none; } +.md-typeset a:not(.md-button) { text-decoration:underline; text-underline-offset:.18em; } +.md-typeset .md-button--primary { color:var(--pw-on-primary); background:var(--pw-primary); border-color:var(--pw-primary); } +.md-typeset .md-button--primary:hover { color:var(--pw-on-primary); background:var(--pw-primary-hover); border-color:var(--pw-primary-hover); } +.md-typeset .admonition,.md-typeset details { border-radius:var(--pw-radius); box-shadow:none; } +.md-typeset :is(.admonition,details).success { border-color:var(--pw-success); } +.md-typeset :is(.admonition,details).success > :is(.admonition-title,summary){ background:var(--pw-success-bg); } +.md-typeset :is(.admonition,details).success > :is(.admonition-title,summary)::before { background-color:var(--pw-success); } +.md-typeset :is(.admonition,details).warning { border-color:var(--pw-warning); } +.md-typeset :is(.admonition,details).warning > :is(.admonition-title,summary) { background:var(--pw-warning-bg); } +.md-typeset :is(.admonition,details).warning > :is(.admonition-title,summary)::before { background-color:var(--pw-warning); } +.md-typeset :is(.admonition,details).danger { border-color:var(--pw-danger); } +.md-typeset :is(.admonition,details).danger > :is(.admonition-title,summary) { background:var(--pw-danger-bg); } +.md-typeset :is(.admonition,details).danger > :is(.admonition-title,summary)::before { background-color:var(--pw-danger); } +.md-typeset :is(.admonition,details).note { border-color:var(--pw-info); } +.md-typeset :is(.admonition,details).note > :is(.admonition-title,summary) { background:var(--pw-info-bg); } +.md-typeset :is(.admonition,details).note > :is(.admonition-title,summary)::before { background-color:var(--pw-info); } +:focus-visible { outline:2px solid var(--pw-focus); outline-offset:3px; } +@media(forced-colors:active) { :focus-visible { outline-color:Highlight; } } diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 0000000..2e1bb02 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,88 @@ + + + + +Carbon & Signal — Packet Warriors design system + + + + + +
+
PACKETWARRIORS
Design system / 01
+
Precision industrial · Carbon & Signal

Built for
the signal.

Independent engineering for amateur radio. Warm neutrals, deliberate red markings, instrument amber, and Jade for operational feedback.

+
+
Illustrative data · not connected to a radio
+
+
Packet Warriors / Software
XLX OBSERVATORY
Server online
+
+
PACKETWARRIORS
N8EI / Engineering tools
+
+
+
01 / Typography

IBM Plex Sans

Engineering clarity. Human character.

400 body · 600 controls/headings · 700 wordmarks

IBM Plex Mono: N8EI / 145.250 MHz / 18:42:07 UTC
+
02 / Semantic states

Signals, not decoration

ConnectedAttentionFailedIdle
Success: operation complete.
+
+

Carbon & Signal · v1.0 / Local offline specimen · Font uses installed IBM Plex or system fallback

+
+ + diff --git a/examples/theme.js b/examples/theme.js new file mode 100644 index 0000000..35df901 --- /dev/null +++ b/examples/theme.js @@ -0,0 +1,21 @@ +/* Optional. Load before CSS to avoid flash. Do not use for Zensical; it owns its toggle. */ +(() => { + const key = 'pw-theme', root = document.documentElement; + const media = matchMedia('(prefers-color-scheme: dark)'); + let preference = 'auto'; + try { preference = localStorage.getItem(key) || 'auto'; } catch {} + if (!['light','dark','auto'].includes(preference)) preference = 'auto'; + function apply() { + const mode = preference === 'auto' ? (media.matches ? 'dark' : 'light') : preference; + root.dataset.pwTheme = mode; + root.dataset.bsTheme = mode; + } + window.setPacketWarriorsTheme = mode => { + if (!['light','dark','auto'].includes(mode)) return; + preference = mode; + try { localStorage.setItem(key, mode); } catch {} + apply(); + }; + media.addEventListener('change', apply); + apply(); +})(); diff --git a/favicon.svg b/favicon.svg new file mode 100644 index 0000000..a56e229 --- /dev/null +++ b/favicon.svg @@ -0,0 +1 @@ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..e97580d --- /dev/null +++ b/index.html @@ -0,0 +1,114 @@ + + + + +Carbon & Signal — Packet Warriors Design System + + + + + + + + + +
+ PACKETWARRIORSDESIGN SYSTEM +
v1.0.0 • CARBON & SIGNAL
+
+
+ +
+
+
PACKET WARRIORS / VISUAL STANDARD
+

Carbon
& Signal.

A precision-industrial design system for amateur radio software.

Purpose-built interfaces. Warm carbon surfaces, deliberate red markings, instrument amber, and Jade operational feedback. Technical, independent, and unmistakably Packet Warriors.

+
PW / C&SVISUAL STANDARD 01
PACKETWARRIORS
PRECISION INDUSTRIAL2026 / N8EI
+
01 / Technical

Information first. Every component earns its place.

02 / Independent

Own the look, without depending on a framework.

03 / Operational

Readable, keyboard-friendly, and built for real radio work.

+
+ +
IDENTITY

One family. Distinct instruments.

Keep the master brand stable and let product-specific accents identify individual tools. Wordmarks below are design specimens, not replacements for existing product artwork.

+
DARK / MASTER
PACKETWARRIORS

Independent engineering. Amateur radio software.

LIGHT / MASTER
PACKETWARRIORS

Independent engineering. Amateur radio software.

+
FIREFLY LOGGER

Field operations and contact logging.

PRODUCT / AMBER
FIREFLY QSL

Contact confirmation and QSL management.

PRODUCT / AMBER
XLX OBSERVATORY

Reflector and network monitoring.

PRODUCT / SIGNAL
+

Use

  • Red PACKET, neutral WARRIORS; monochrome when necessary.
  • Sharp, restrained forms and a narrow Signal Red rule.
  • Product identity only where it aids recognition.

Avoid

  • Blue-gray canvases, neon glow, glass and decorative gradients.
  • Coral or pink brand wordmarks.
  • Material-style oversized pills, heavy shadow and ornamental dashboard clutter.
+
+ +
FOUNDATIONS / COLOR

Color is a signal.

The approved brand palette stays fixed. Semantic and interaction colors adjust for each appearance mode, especially where small text must remain legible.

+
+

Functional tokens

Click either swatch to copy its hexadecimal value.

+
TokenPurposeLightDark

+
Brand red is not body text. Keep Signal Red in branding and filled actions. Use neutral underlined links on dark surfaces. Light red is reserved for meaningful error labels, never the wordmark.
+
✓ Success / connected

Jade. Positive state with text, not color alone.

! Warning / pending

Amber. Attention without suggesting failure.

× Error / critical

Red. A genuine error or destructive action.

ⓘ Information / idle

Pewter and neutral. Context without alarm.

+
+ +
FOUNDATIONS / TYPE

Engineered clarity.

IBM Plex Sans is the primary family. IBM Plex Mono is reserved for callsigns, frequencies, timestamps, commands and identifiers. Use installed or self-hosted font files; the guide falls back gracefully when Plex isn't available.

+
Aa01

IBM Plex Sans

400 regular · 600 semibold · 700 bold

N8EI_

IBM Plex Mono

145.250 MHz · 18:42:07 UTC

+
Display / 36px

Built for the signal.

Page title / 28px

Reflector activity

Section / 22px

Recently heard stations

Body / 16px

Configure the service and verify that the dashboard is online.

Dense data / 14px

N8EI   DMR   18:42:07 UTC

Metadata / 13px

Last updated 3 seconds ago

+
+ +
FOUNDATIONS / SURFACES

Structure, not decoration.

Create hierarchy using restrained contrast between adjacent layers. Avoid artificial depth and oversized cards.

+
Canvas
Surface
Raised
Recessed control
+

Spacing scale

Geometry

4Control radius
6Panel radius
40Desktop control
44Touch control

Measurements in pixels at default font settings. Keep zoom and font scaling functional.

+
+ +
INTERFACE / COMPONENTS

Live component library.

These specimens use the shipped native CSS. Switch the product to see the primary action and mark change independently of the shared status colors.

+
Appearance follows the page setting
+
+

Buttons & focus

Explicit labels, solid primary, restrained alternatives.

.pw-btn

Select a specimen to test its feedback.

HTML example
<button class="pw-btn pw-btn-primary">Save changes</button>
+<button class="pw-btn">Cancel</button>
+<button class="pw-btn pw-btn-danger">Remove item</button>
+

Forms & validation

Visible labels, bordered insets and accessible feedback.

.pw-input
Enter a valid value
Local specimen only; no contacts are submitted.
HTML example
<label class="pw-label" for="call">Callsign</label>
+<input class="pw-input pw-mono" id="call" required>
+

Statuses & alerts

Pair color with text or a recognizable symbol.

.pw-status
ConnectedPendingFailedIdle
✓ Contact saved. Sample data recorded.
! Attention. Confirm your operating section.
× Connection failed. Check the network and retry.
HTML example
<span class="pw-status pw-success">Connected</span>
+<div class="pw-alert pw-warning" role="status">
+  <strong>Attention.</strong> Confirm your operating section.
+</div>
+

Navigation, panels & tables

Dense data with meaningful headers and readable contrast.

.pw-table
Recently heard users
CallsignModuleProtocolStatusLast heard
N8EIADMROn air18:42:07
W8WKYBD-StarIdle18:40:12
HTML example
<div class="pw-panel">
+  <div class="pw-panel-title">Recently heard</div>
+  <div class="pw-table-wrap">
+    <table class="pw-table">…</table>
+  </div>
+</div>
+
+ +
INTERFACE / PATTERNS

From documentation to the field.

The live application gallery brings the same tokens to five different use cases. All data is illustrative; no radio, logger or reflector is connected.

+ +
INTERFACE / ACCESSIBILITY

Operational accessibility.

The interfaces must remain useful in the field and for operators who rely on keyboard navigation, large text, or high-contrast settings.

Contrast & states

  • Normal text: aim for at least 4.5:1.
  • Control boundaries and focus: at least 3:1 against adjacent surfaces.
  • Use state labels and icons in addition to color.
  • Retain accessible names, visible labels and meaningful error messages.
Read palette contrast calculations

Keyboard & field use

  • Retain tab order, shortcuts, focus and Enter submission.
  • 44px touch controls; test landscape and portrait tablets.
  • Maintain zoom to 200% and respect forced colors.
  • Night mode: low-luminance surfaces, no flashing or bright modal backgrounds.
Contrast calculations are not an accessibility certification. Retest actual components, states, relative sizes, embedded widgets and user workflows in both themes.
+ +
IMPLEMENTATION / FRAMEWORKS

One token contract. Three integration paths.

Use the central --pw-* variables rather than inventing new colors in each project. The adapters are designed as starter integrations, not drop-in patches against a verified repository revision.

+
BOOTSTRAP 5.3

Firefly

Keep Bootstrap for familiar hand-written UI. Override global and component variables after Bootstrap's compiled CSS.

<html data-bs-theme="dark"
+      data-pw-product="firefly">
Download adapter
NATIVE CSS

Observatory

Map existing style variables to tokens or use the opt-in components. No build step required.

<html data-pw-theme="dark"
+      data-pw-product="packet">
Download components
ZENSICAL

Documentation

Keep default and slate schemes. Merge the provided palette entries and load the CSS after tokens.

scheme = "slate"
+primary = "custom"
+accent = "custom"
Download configuration
+

Load order

  1. Framework CSS (if applicable)
  2. pw-tokens.css
  3. pw-fonts.css (with local fonts, optional)
  4. Relevant component or framework adapter
  5. App-specific overrides
<link rel="stylesheet" href="css/pw-tokens.css">
+<link rel="stylesheet" href="css/pw-components.css">

Keep only one theme manager in the application. Use data-pw-theme for native apps and align it with data-bs-theme where Bootstrap is present. Zensical owns its own toggle.

+ +
IMPLEMENTATION / RETROFIT

Refactor without breaking operations.

A visual retrofit must preserve the behaviors and shortcuts operators rely on. Do not treat a design refresh as permission to redesign application logic.

+
01

Inventory

Inspect framework, existing colors, font files, CSS specificity, theme switch, keyboard handlers, mobile breakpoints and custom logos. Record screenshots of critical flows before editing.

02

Map

Map old variables to canvas, surface, raised, inset, text, borders, product actions, and semantic states. Remove hard-coded colors only where needed.

03

Implement

Start with one representative screen. Keep application logic, endpoints, focus order, accessibility labels and generated outputs unchanged.

04

Verify

Test light/dark/system, actual content, keyboard, tablet dimensions, zoom, forced colors, and app-specific operations. Compare with the maintained specimens.

+

Firefly Logger

Do not alter hotkeys, focus behavior, Enter submission, dupe detection, hand-key entry, offline use, or exports. Test field operation in darkness and on a tablet.

Firefly QSL

Preserve ADIF upload, lookup, selection, iframe use and generated QSL artwork/printing. Recolor the application chrome only.

XLX Observatory

Preserve SSE updates, table sorting, time zone display, configuration and replaceable reflector logo. Keep the Go service dependency-light.

Zensical / website

Merge configuration rather than replacing navigation or plugins. Test search, code highlighting, admonitions, links and both schemes.

+
+ +
IMPLEMENTATION / CODING AGENTS

Give agents a clear contract.

Include the following files in each repository, or provide the canonical styleguide URL. They are written as explicit project instructions for both ChatGPT/Codex and Claude Code.

+
CODEX / UNIVERSAL

AGENTS.md

Design system rules, source-of-truth files, retrofit workflow, and required verification.

Download AGENTS.md
CLAUDE CODE

CLAUDE.md

Self-contained reference with the same brand and behavioral requirements.

Download CLAUDE.md
AGENT / MACHINE READABLE

llms.txt + tokens.json

Concise index for agents plus the canonical role values in JSON.

+

Retrofit prompt

Use this as the starting instruction for an existing project.

Apply the Packet Warriors Carbon & Signal v1.0 design system to this repository. Read AGENTS.md, tokens.json, the relevant CSS adapter and the styleguide first. Inventory the current UI, theme manager, keyboard shortcuts and tests. Preserve all functionality, data flows, focus order and existing product identity. Map existing colors to --pw-* tokens; implement light and dark appearances with no blue-gray or coral branding. Use IBM Plex, restrained surfaces, Signal Red for Packet Warriors, Amber for Firefly, and Jade for positive states. Test critical operations, keyboard navigation, tablet layout, contrast, and both themes. Report changes, verification and any unresolved limitations.
+

New project prompt

Use this before creating new amateur-radio tools.

Create this tool using Packet Warriors Carbon & Signal v1.0. Read AGENTS.md, tokens.json and the styleguide. Choose the simplest framework appropriate to the requirements; import pw-tokens.css and the appropriate adapter. Use the shared product-family architecture, IBM Plex typography, layered warm surfaces, visible keyboard focus, semantic feedback, tablet-friendly controls, and independent light/dark/system modes. Default to Signal Red unless the product is Firefly. Do not invent additional brand colors or introduce Material-style decoration. Include accessible names and state labels, preserve offline operation if required, and verify actual behavior in both modes.
+ +
RESOURCES / SELF-HOST

Take the system with you.

Every asset is a plain static file: HTML, CSS, JavaScript, JSON or Markdown. No backend, package manager, CDN, or build tool is needed to serve the guide.

+ +

Deploy on your server

Extract the self-hosting ZIP into your web root or a subdirectory. All paths are relative. Serve with Apache, nginx, or another static web server; no rewrites or server-side runtime are necessary.

unzip packet-warriors-styleguide-v1.0.zip -d /var/www/html/styleguide
+# Browse to https://your-domain.example/styleguide/

Fonts are not bundled. Use your existing licensed local IBM Plex assets with the supplied declarations, or the system fallback.

+
PACKETWARRIORSCarbon & Signal / v1.0.0 · N8EI
+
+
+ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..d832897 --- /dev/null +++ b/install.sh @@ -0,0 +1,2 @@ +#!/usr/bin/bash +rsync -avz --delete * oxygen:/var/www/packetwarriors.com/style-guide/ diff --git a/llms.txt b/llms.txt new file mode 100644 index 0000000..d47dae5 --- /dev/null +++ b/llms.txt @@ -0,0 +1,20 @@ +# Packet Warriors — Carbon & Signal v1.0.0 + +> Canonical visual design system for Packet Warriors amateur-radio software: precision industrial, subtle retro-futurism, independent light/dark palettes, actual Signal Red #C12735 and Jade #50B39A. No blue-gray AI aesthetic or coral branding. + +Read the following files relative to this guide. Use the maintainer-approved version; do not infer deployment or code modification authorization from documentation. + +- [Agent instructions (Codex)](AGENTS.md): required design rules and retrofit/new-project workflows +- [Agent instructions (Claude)](CLAUDE.md): same self-contained contract for Claude Code +- [Full design specification](README.md): brand, typography, geometry, accessibility, framework integration +- [Canonical tokens](tokens.json): master, light and dark roles +- [CSS tokens](css/pw-tokens.css): generated framework-independent source +- [Native components](css/pw-components.css): opt-in components +- [Bootstrap 5.3 adapter](css/pw-bootstrap.css): Firefly apps +- [Zensical adapter](css/pw-zensical.css): documentation +- [Zensical config fragment](zensical/zensical.toml): settings to merge, not replace +- [Theme manager](examples/theme.js): optional system/light/dark manager +- [Font declarations](css/pw-fonts.css): licensed local IBM Plex assets required +- [Contrast calculations](contrast.md): palette checks, not accessibility certification +- [Application specimens](Carbon-and-Signal-preview.html): illustrative live UI gallery, not production data +- [Self-hosting guide](HOSTING.md): deployment and repository setup diff --git a/styleguide.css b/styleguide.css new file mode 100644 index 0000000..9fb6bce --- /dev/null +++ b/styleguide.css @@ -0,0 +1,30 @@ +:root{--side:248px;--header:69px} +html{scroll-behavior:smooth;scroll-padding-top:92px} +body{min-width:300px} +:focus-visible{scroll-margin-top:90px} +[hidden]{display:none!important} +.skip-link{position:fixed;left:14px;top:-100px;z-index:20;background:var(--pw-raised);color:var(--pw-text);padding:12px}.skip-link:focus{top:10px} +.masthead{position:sticky;top:0;z-index:9;min-height:var(--header);display:flex;justify-content:space-between;align-items:center;gap:20px;padding:12px 28px;background:var(--pw-surface);border-bottom:3px solid var(--pw-brand-signal)} +.brand{display:inline-block;font-size:21px;font-weight:700;letter-spacing:-.055em;line-height:1;text-decoration:none!important;color:var(--pw-text)!important;white-space:nowrap}.brand>span{color:var(--pw-brand-signal)}.brand small{display:block;font:500 10px/1.5 var(--pw-mono);letter-spacing:.15em;margin-top:5px;color:var(--pw-muted)} +.header-right{display:flex;gap:18px;align-items:center}.version-label{font:400 .76rem var(--pw-mono);color:var(--pw-muted)}.version-label b{color:var(--pw-success)} +.mode-switch{display:flex;border:1px solid var(--pw-control-border);border-radius:4px;overflow:hidden} +.mode-switch button{padding:7px 12px;border:0;border-right:1px solid var(--pw-border);background:var(--pw-inset);color:var(--pw-muted);font:600 .875rem var(--pw-font);cursor:pointer;min-height:36px}.mode-switch button:last-child{border-right:0}.mode-switch button[aria-pressed=true]{background:var(--pw-raised);color:var(--pw-text);box-shadow:inset 0 -2px var(--pw-brand-signal)}.mode-switch button:focus-visible{outline-offset:-3px} +.mobile-menu{display:none}.layout{display:grid;grid-template-columns:var(--side) minmax(0,1fr);max-width:1600px;margin:auto} +.sidebar{border-right:1px solid var(--pw-border);background:var(--pw-surface);min-width:0}.sidebar-inner{position:sticky;top:var(--header);max-height:calc(100vh - var(--header));overflow:auto;padding:22px 19px;display:flex;flex-direction:column}.search-label{font-size:.8125rem;color:var(--pw-muted);font-weight:600;margin-bottom:5px}.nav-search{font-size:.875rem;min-height:36px}.nav-group{margin:24px 0}.nav-group>span{display:block;font:600 .72rem var(--pw-mono);letter-spacing:.09em;color:var(--pw-muted);text-transform:uppercase;margin-bottom:8px}.nav-group a{display:block;text-decoration:none;color:var(--pw-text);font-size:.875rem;padding:6px 9px;border-left:2px solid transparent;min-height:34px}.nav-group a:hover{background:var(--pw-hover)}.nav-group a.active{border-left-color:var(--pw-brand-signal);background:var(--pw-raised);font-weight:600}.sidebar-footer{font-size:.8125rem;color:var(--pw-text);border-top:1px solid var(--pw-border);padding-top:18px;display:flex;align-items:flex-start;gap:9px}.signal-dot{display:inline-block;border-radius:50%;background:var(--pw-success);width:8px;height:8px;margin-top:6px} +main{padding:0 clamp(22px,4vw,64px);min-width:0;max-width:1320px}.hero{padding:43px 0 35px;border-bottom:1px solid var(--pw-border)}.eyebrow,.section-kicker{color:var(--pw-muted);font:600 .75rem var(--pw-mono);letter-spacing:.1em}.eyebrow{display:flex;align-items:center;gap:10px}.line{width:24px;height:3px;background:var(--pw-brand-signal)}.hero-layout{display:grid;grid-template-columns:1.15fr 1fr;gap:40px;align-items:center;margin:25px 0 35px}.hero h1{font-size:clamp(3.1rem,6.1vw,5.9rem);line-height:.93;letter-spacing:-.07em;font-weight:700;margin:0 0 20px}.hero h1 i{color:var(--pw-muted);font-style:normal;font-size:.8em;font-weight:400}.period{color:var(--pw-brand-signal)}.hero-lead{font-size:1.25rem;font-weight:600;line-height:1.4;max-width:420px}.muted{color:var(--pw-muted)}.small{font-size:.8125rem}.mono{font-family:var(--pw-mono);font-variant-numeric:tabular-nums}.actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:20px}.actions a{text-decoration:none}.hero-plate{position:relative;padding:27px 24px;color:#E8E6DF;background:#22221F;border:1px solid #6C6A62;border-radius:5px;box-shadow:inset 0 0 0 7px #171715;aspect-ratio:1.1;min-height:226px;display:flex;flex-direction:column;justify-content:space-between}.plate-meta,.plate-bottom{display:flex;justify-content:space-between;gap:8px;font:400 .7rem var(--pw-mono);letter-spacing:.04em;color:#B8B5AB}.plate-mark{font-size:clamp(1.25rem,3.1vw,2.65rem);font-weight:700;letter-spacing:-.07em;white-space:nowrap}.plate-mark b{color:#C12735}.plate-rule{height:3px;background:#C12735}.plate-swatches{display:grid;grid-template-columns:repeat(8,1fr);border:1px solid #484840}.plate-swatches>div{height:46px}.plate-rivets{position:absolute;inset:7px;pointer-events:none}.plate-rivets i{position:absolute;background:#77766E;border-radius:50%;width:5px;height:5px}.plate-rivets i:nth-child(2){right:0}.plate-rivets i:nth-child(3){bottom:0}.plate-rivets i:nth-child(4){right:0;bottom:0}.principles{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.principles>div{border-top:2px solid var(--pw-border);padding-top:14px}.principles b{font-size:.9rem}.principles p{font-size:.875rem;color:var(--pw-muted);margin-bottom:0} +.section{padding:42px 0;border-bottom:1px solid var(--pw-border);scroll-margin-top:12px}.section h2{font-size:clamp(1.8rem,3vw,2.5rem);font-weight:700;letter-spacing:-.045em;margin:10px 0}.section-intro{max-width:790px;color:var(--pw-muted);font-size:1.03rem;margin:0 0 25px}.section h3{font-size:1.18rem;letter-spacing:-.02em}.section p{line-height:1.55}.two-col,.brand-board,.semantic-grid,.type-board,.integration-grid,.agent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}.product-grid,.integration-grid,.agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.wordmark-specimen{padding:23px;border-radius:5px;display:flex;flex-direction:column;gap:18px;min-width:0;border:1px solid #77766E}.dark-spec{background:#171715;color:#E8E6DF}.light-spec{background:#F2EFE9;color:#272620}.sample-label{font:.72rem var(--pw-mono);opacity:.8}.sample-mark{font-size:clamp(1rem,2vw,2rem);letter-spacing:-.055em;font-weight:700;white-space:nowrap}.sample-mark b,.red-text{color:#C12735}.sample-rule{height:3px;background:#C12735}.wordmark-specimen p{margin:0;font-size:.85rem}.product{padding:17px}.product-indicator{display:block;width:35px;height:3px;margin-bottom:18px}.amber{background:var(--pw-firefly)}.red{background:#C12735}.amber-text{color:var(--pw-firefly)}.product-name{font-weight:600;font-size:1rem;letter-spacing:-.03em}.product p{margin:8px 0 18px;color:var(--pw-muted);font-size:.9rem}.inset-card{padding:19px;min-width:0;margin:0}.inset-card ul,.inset-card ol{padding-left:20px;margin-bottom:0}.inset-card li{margin:7px 0}.inset-card p{margin:8px 0 12px}.inset-card a{font-weight:600} +.swatch-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.swatch{overflow:hidden;border:1px solid var(--pw-border);border-radius:4px;text-align:left;padding:0;background:var(--pw-surface);font:inherit;color:var(--pw-text);cursor:pointer}.swatch-color{height:64px;display:block}.swatch .swatch-info{padding:9px;display:block}.swatch strong{display:block;font-size:.875rem}.swatch code{font-size:.75rem;color:var(--pw-muted)}.subheading{margin-top:27px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;align-items:end}.subheading p{margin:0 0 12px}.filter-label{font-size:.8125rem;color:var(--pw-muted);width:235px;margin-bottom:10px}.filter-label input{display:block;margin-top:4px;font-size:.875rem}.token-table th,.token-table td{vertical-align:middle}.token-table td:first-child{white-space:nowrap;font-family:var(--pw-mono);font-size:.79rem}.token-copy{display:flex;align-items:center;gap:8px;border:0;background:transparent;cursor:pointer;color:var(--pw-text);font:400 .78rem var(--pw-mono);padding:4px;text-align:left;white-space:nowrap}.token-copy span{width:22px;height:22px;border:1px solid #77766E;border-radius:3px}.token-copy:hover{text-decoration:underline}.callout{margin-top:16px;border-left:3px solid var(--pw-brand-signal);padding:12px 15px;background:var(--pw-surface);border-radius:0 4px 4px 0;color:var(--pw-text)}.semantic-grid .pw-alert p{margin:6px 0 0;font-size:.9rem} +.type-board{padding:26px}.type-board>div{padding:8px 10px;min-width:0}.type-board>div+div{border-left:1px solid var(--pw-border);padding-left:25px}.type-display{font-size:clamp(2.5rem,5vw,4.8rem);font-weight:700;line-height:1.15;letter-spacing:-.08em}.type-display span{color:var(--pw-brand-signal)}.type-board p{font-size:.875rem;color:var(--pw-muted)}.scale-list{padding:0 20px}.scale-list>div{display:grid;grid-template-columns:150px 1fr;gap:15px;align-items:center;border-bottom:1px solid var(--pw-border);padding:13px 0}.scale-list>div:last-child{border:0}.scale-list span{font:400 .78rem var(--pw-mono);color:var(--pw-muted)}.scale-list p{margin:0;line-height:1.4} +.surface-board{padding:17px}.surface-layer{border:1px solid var(--pw-border);border-radius:4px;padding:12px 17px;margin-top:10px;font:500 .875rem var(--pw-mono);color:var(--pw-muted)}.surface-layer>span{display:block;margin-bottom:4px}.surface-layer.canvas{background:var(--pw-canvas);margin:0}.surface-layer.surface{background:var(--pw-surface)}.surface-layer.raised{background:var(--pw-raised)}.surface-layer.recessed{background:var(--pw-inset);border-color:var(--pw-control-border);max-width:260px;min-height:40px}.spacing-demo{display:grid;gap:10px}.spacing-demo>div{display:flex;align-items:center;gap:10px;font:.8rem var(--pw-mono)}.spacing-demo b{display:block;background:var(--pw-brand-signal);height:12px}.geometry-demo{display:grid;grid-template-columns:repeat(2,1fr);gap:13px}.geometry-demo>div{display:flex;gap:10px;align-items:center}.geometry-demo span{border:1px solid var(--pw-control-border);display:grid;place-items:center;width:44px;height:36px;font:400 .8rem var(--pw-mono);color:var(--pw-text)}.geometry-demo small{font-size:.78rem;color:var(--pw-muted)}.radius-4{border-radius:4px}.radius-6{border-radius:6px}.geometry-demo .height-40{height:40px}.geometry-demo .height-44{height:44px} +.component-control{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:14px}.component-block{margin:14px 0;overflow:hidden}.component-title{display:flex;justify-content:space-between;align-items:center;gap:15px;background:var(--pw-raised);padding:14px 18px;border-bottom:1px solid var(--pw-border)}.component-title h3{margin:0}.component-title p{font-size:.875rem;color:var(--pw-muted);margin:4px 0 0}.component-title code{font-size:.8rem;color:var(--pw-muted)}.component-demo{padding:20px}.component-demo .pw-btn{margin:0 4px 8px 0}.focus-demo{outline:2px solid var(--pw-focus);outline-offset:3px}.snippet{border-top:1px solid var(--pw-border);padding:10px 18px;background:var(--pw-inset)}.snippet summary{cursor:pointer;font-size:.875rem;font-weight:600}.snippet pre{margin:12px 0 0}.form-spec{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.form-spec .checkline,.form-spec #form-state{grid-column:1/-1}.checkline{display:flex;flex-wrap:wrap;gap:20px;font-size:.875rem}.checkline input{accent-color:var(--pw-brand-signal)}.field-error{font-size:.78rem;color:var(--pw-danger)}.status-line{display:flex;flex-wrap:wrap;gap:20px;margin-bottom:15px}.component-demo .pw-alert{margin-top:10px}.sample-tab{font:600 .875rem var(--pw-font);color:var(--pw-muted);background:transparent;border:0;border-bottom:2px solid transparent;padding:9px 6px;cursor:pointer}.sample-tab.active{color:var(--pw-text);border-bottom-color:var(--pw-action)}.component-demo .pw-nav{margin-bottom:14px} +.pattern-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.pattern-card{display:flex;flex-direction:column;gap:7px;text-decoration:none!important;background:var(--pw-surface);border:1px solid var(--pw-border);border-radius:4px;padding:10px;color:var(--pw-text)!important}.pattern-card:hover{border-color:var(--pw-control-border)}.pattern-card small{color:var(--pw-muted);line-height:1.4;font-size:.8rem}.pattern-graphic{display:flex;flex-direction:column;gap:8px;background:#171715;color:#E8E6DF;min-height:135px;padding:12px;border-top:3px solid #C12735}.pattern-graphic>span{font:.65rem var(--pw-mono);color:#B8B5AB}.pattern-graphic b{font-size:1.8rem;line-height:1}.pattern-graphic i{font:400 .7rem var(--pw-mono);font-style:normal;color:#50B39A}.mini-rows{height:35px;background:repeating-linear-gradient(to bottom,#2E2E2A 0 8px,#171715 8px 11px)}.mini-input{background:#2E2E2A;padding:4px;font:.75rem var(--pw-mono);display:flex;justify-content:space-between}.mini-input em{font-style:normal;color:#171715;background:#DAB16B;padding:2px}.doc-mini{background:#F2EFE9;color:#272620}.doc-mini>span{color:#615F56}.doc-mini .mini-rows{background:repeating-linear-gradient(to bottom,#D5D2C8 0 7px,#F2EFE9 7px 11px)}.doc-mini i{color:#186950} +.frame-label{font:.75rem var(--pw-mono);color:var(--pw-muted);display:block;margin-bottom:10px}.integration-grid pre{min-height:83px}.pw-app pre{font:400 .83rem/1.55 var(--pw-mono);background:var(--pw-inset);color:var(--pw-text);border:1px solid var(--pw-border);padding:12px;border-radius:4px;white-space:pre-wrap;overflow-wrap:anywhere}.section code{font-family:var(--pw-mono)}.load-order{columns:2}.steps{display:grid;gap:12px;margin-bottom:18px}.steps article{display:flex;gap:16px;align-items:flex-start;border-block-start:1px solid var(--pw-border);padding-top:14px}.steps article>span{font:600 1.4rem var(--pw-mono);color:var(--pw-muted);min-width:40px}.steps h3,.steps p{margin:0 0 6px}.agent-grid .pw-btn{text-decoration:none;width:100%}.agent-grid article{display:flex;flex-direction:column;align-items:flex-start}.agent-grid article p{flex:1}.agent-grid article .actions{margin-top:0}.prompt-box{position:relative}.prompt-box pre{padding-right:16px}.prompt-box .copy{margin-top:4px}.section>.inset-card+.inset-card{margin-top:15px}.resource-table{margin-bottom:16px}.resource-table a{display:flex;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid var(--pw-border);text-decoration:none}.resource-table a:last-child{border:none}.resource-table a:hover{background:var(--pw-hover)}.resource-table strong{color:var(--pw-text)}.resource-table span{font:.78rem var(--pw-mono);color:var(--pw-muted);text-align:right} +.main-footer{display:flex;justify-content:space-between;align-items:center;font-size:.8rem;color:var(--pw-muted);padding:22px 0;gap:12px}.small-brand{font-size:1rem}.toast{position:fixed;bottom:20px;right:20px;padding:12px 16px;background:var(--pw-raised);color:var(--pw-text);border:1px solid var(--pw-control-border);border-left:4px solid var(--pw-success);border-radius:4px;z-index:20} +@media(max-width:1150px){.hero-layout{gap:22px}.swatch-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.version-label{display:none}.agent-grid,.integration-grid,.product-grid{grid-template-columns:1fr}.plate-mark{font-size:clamp(1.1rem,2.9vw,2.2rem)}} +@media(max-width:850px){:root{--side:210px}.hero-layout{grid-template-columns:1fr}.hero-plate{aspect-ratio:auto;gap:27px;max-width:550px}.plate-mark{font-size:clamp(1.6rem,5vw,2.8rem)}.brand-board,.two-col,.semantic-grid{grid-template-columns:1fr}.pattern-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-spec{grid-template-columns:1fr 1fr}.swatch-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.token-table{min-width:530px}} +@media(max-width:680px){:root{--header:65px}.masthead{padding:10px 14px;gap:8px;flex-wrap:wrap}.brand{font-size:18px}.header-right{gap:8px}.mode-switch button{padding:6px 8px;font-size:.75rem}.mobile-menu{display:block;background:var(--pw-surface);color:var(--pw-text);border:1px solid var(--pw-control-border);border-radius:4px;padding:8px;font:600 .78rem var(--pw-font)}.layout{display:block}.sidebar{display:none;position:sticky;top:var(--header);z-index:8;border-bottom:1px solid var(--pw-border)}.sidebar.open{display:block}.sidebar-inner{max-height:70vh;position:static}.nav-group{margin:10px 0}.sidebar-footer{display:none}main{padding:0 16px}.hero,.section{padding:28px 0}.hero h1{font-size:3.6rem}.hero-plate{padding:20px}.principles,.type-board{grid-template-columns:1fr}.type-board>div+div{border-left:0;border-top:1px solid var(--pw-border);padding-left:10px;padding-top:20px}.scale-list>div{grid-template-columns:1fr;gap:5px}.swatch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-spec{grid-template-columns:1fr}.pattern-grid{grid-template-columns:1fr 1fr}.resource-table a{flex-direction:column}.resource-table span{text-align:left}.load-order{columns:1}.main-footer{flex-wrap:wrap}.hero-plate .plate-meta,.plate-bottom{font-size:.62rem}} +@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}} +@media(pointer:coarse){.mode-switch button,.nav-group a,.sample-tab{min-height:44px}} +.pw-app a.pw-btn-primary{color:var(--pw-on-action);text-decoration:none} +.pw-app a.pw-btn:not(.pw-btn-primary){color:var(--pw-text);text-decoration:none} +@media(forced-colors:active){.mode-switch button[aria-pressed=true],.nav-group a.active{border:2px solid Highlight}.swatch-color,.token-copy span{forced-color-adjust:none}.sample-tab.active{border-bottom-color:Highlight}} diff --git a/styleguide.js b/styleguide.js new file mode 100644 index 0000000..c50f143 --- /dev/null +++ b/styleguide.js @@ -0,0 +1,113 @@ +const PW_TOKENS = { + "version": "1.0.0", + "brand": { + "carbon": "#171715", + "graphite": "#2E2E2A", + "pewter": "#B8B5AB", + "porcelain": "#F2EFE9", + "signal": "#C12735", + "signal-bright": "#D32939", + "signal-deep": "#861E28", + "amber": "#DAB16B", + "jade": "#50B39A", + "copper": "#C79A80" + }, + "light": { + "canvas": "#F2EFE9", + "surface": "#FFFCF7", + "raised": "#E1DED5", + "inset": "#F8F5EF", + "text": "#272620", + "muted": "#615F56", + "border": "#CBC7BD", + "control-border": "#817D72", + "focus": "#A52C36", + "link": "#A52C36", + "primary": "#C12735", + "on-primary": "#FFFFFF", + "primary-hover": "#A51F2C", + "primary-active": "#861E28", + "firefly": "#8A5D20", + "on-firefly": "#FFFFFF", + "firefly-hover": "#704A17", + "firefly-active": "#593B13", + "success": "#186950", + "success-bg": "#DFEDE6", + "warning": "#785018", + "warning-bg": "#EEE5D3", + "danger": "#A52C36", + "danger-bg": "#F2DDDD", + "info": "#615F56", + "info-bg": "#E7E4DC", + "inactive": "#615F56", + "selection": "#EFD8D7", + "on-selection": "#272620", + "hover": "#EEEAE1", + "disabled": "#77736A", + "disabled-bg": "#E7E3DA" + }, + "dark": { + "canvas": "#171715", + "surface": "#22221F", + "raised": "#2E2E2A", + "inset": "#141412", + "text": "#E8E6DF", + "muted": "#ADA99F", + "border": "#484840", + "control-border": "#7A7971", + "focus": "#DAB16B", + "link": "#D8D4C9", + "primary": "#C12735", + "on-primary": "#FFFFFF", + "primary-hover": "#D32939", + "primary-active": "#A82330", + "firefly": "#DAB16B", + "on-firefly": "#171715", + "firefly-hover": "#E6C28A", + "firefly-active": "#C39955", + "success": "#50B39A", + "success-bg": "#1C332D", + "warning": "#DAB16B", + "warning-bg": "#352C1D", + "danger": "#F1989C", + "danger-bg": "#3C2225", + "info": "#B8B5AB", + "info-bg": "#30302C", + "inactive": "#ADA99F", + "selection": "#48272A", + "on-selection": "#E8E6DF", + "hover": "#30302C", + "disabled": "#918E85", + "disabled-bg": "#30302C" + } +}; +'use strict'; +const root=document.documentElement, $=s=>document.querySelector(s), $$=s=>Array.from(document.querySelectorAll(s)); +const titleCase=s=>s.replace(/-/g,' ').replace(/\b\w/g,c=>c.toUpperCase()); +let toastTimeout; +function notify(msg){const t=$('#toast');t.textContent=msg;t.hidden=false;clearTimeout(toastTimeout);toastTimeout=setTimeout(()=>t.hidden=true,3000)} +async function copy(value){try{await navigator.clipboard.writeText(value);notify('Copied to clipboard');}catch{try{const e=document.createElement('textarea');e.value=value;e.style.position='fixed';e.style.opacity='0';document.body.append(e);e.select();const ok=document.execCommand('copy');e.remove();if(!ok)throw Error();notify('Copied to clipboard');}catch{notify('Copy unavailable. Select the text manually.')}}} +const stored=(()=>{try{return localStorage.getItem('pw-styleguide-mode')}catch{return null}})(); +const mode=['light','dark','auto'].includes(stored)?stored:'dark'; +function setMode(value){root.dataset.pwTheme=value;$$('[data-mode]').forEach(b=>b.setAttribute('aria-pressed',String(b.dataset.mode===value)));try{localStorage.setItem('pw-styleguide-mode',value)}catch{}} +setMode(mode); +$$('[data-mode]').forEach(b=>b.addEventListener('click',()=>setMode(b.dataset.mode))); +$('#nav-toggle').addEventListener('click',()=>{const open=$('#side-nav').classList.toggle('open');$('#nav-toggle').setAttribute('aria-expanded',String(open))}); +const navLinks=$$('.nav-group a'); +navLinks.forEach(a=>a.addEventListener('click',()=>{$('#side-nav').classList.remove('open');$('#nav-toggle').setAttribute('aria-expanded','false')})); +$('#nav-search').addEventListener('input',e=>{const q=e.target.value.trim().toLowerCase();let visible=0;for(const a of navLinks){const match=!q||a.textContent.toLowerCase().includes(q)||($(a.hash)?.textContent.toLowerCase().includes(q));a.hidden=!match;if(match)visible++}$$('.nav-group').forEach(g=>g.hidden=Array.from(g.querySelectorAll('a')).every(a=>a.hidden));$('#nav-count').hidden=!q;$('#nav-count').textContent=visible+' matching sections'}); +let activeId=''; +function updateNav(){const sections=$$('main section[id]');let current=sections[0].id;for(const s of sections)if(s.getBoundingClientRect().top<160)current=s.id;if(activeId!==current){activeId=current;navLinks.forEach(a=>{const active=a.hash==='#'+current;a.classList.toggle('active',active);if(active)a.setAttribute('aria-current','location');else a.removeAttribute('aria-current')})}} +let scheduled=false;addEventListener('scroll',()=>{if(!scheduled){scheduled=true;requestAnimationFrame(()=>{updateNav();scheduled=false})}},{passive:true});addEventListener('resize',updateNav);updateNav(); +const descriptions={canvas:'Page foundation',surface:'Panels and cards',raised:'Title bars and elevated areas',inset:'Recessed fields and code',text:'Main text',muted:'Secondary text',border:'Decorative separators','control-border':'Interactive control boundaries',focus:'Keyboard focus',link:'Ordinary links',primary:'Master primary action','on-primary':'Primary action text','primary-hover':'Primary hover','primary-active':'Primary pressed',firefly:'Firefly product action','on-firefly':'Amber action text','firefly-hover':'Firefly hover','firefly-active':'Firefly pressed',success:'Connected / success','success-bg':'Positive callout background',warning:'Attention / pending','warning-bg':'Warning callout background',danger:'Error / destructive','danger-bg':'Error callout background',info:'Information','info-bg':'Informational callout',inactive:'Idle / offline',selection:'Selected surface','on-selection':'Selected text',hover:'Hover surface',disabled:'Disabled text','disabled-bg':'Disabled surface'}; +function makeCopy(hex){return ''} +$('#brand-swatches').innerHTML=Object.entries(PW_TOKENS.brand).map(([n,c])=>'').join(''); +function tokens(q=''){const items=Object.entries(PW_TOKENS.light).filter(([k,v])=>[k,v,PW_TOKENS.dark[k],descriptions[k]].join(' ').toLowerCase().includes(q.toLowerCase()));$('#token-rows').innerHTML=items.map(([k,v])=>'--pw-'+k+''+descriptions[k]+''+makeCopy(v)+''+makeCopy(PW_TOKENS.dark[k])+'').join('');$('#token-count').textContent=items.length+' of '+Object.keys(PW_TOKENS.light).length+' functional tokens'} +tokens();$('#token-filter').addEventListener('input',e=>tokens(e.target.value)); +$('#space-demo').innerHTML=[4,8,12,16,24,32].map(n=>'
'+n+'px
').join(''); +document.addEventListener('click',e=>{const c=e.target.closest('[data-hex],[data-copy-target]');if(!c)return;if(c.dataset.hex)copy(c.dataset.hex);else copy(document.getElementById(c.dataset.copyTarget).textContent.trim())}); +$$('[data-product]').forEach(b=>b.addEventListener('click',()=>{$('#component-sandbox').dataset.pwProduct=b.dataset.product;$$('[data-product]').forEach(x=>x.setAttribute('aria-pressed',String(x===b)))})); +$$('[data-demo]').forEach(b=>b.addEventListener('click',()=>$('#button-result').textContent=b.dataset.demo+' selected. No real action performed.')); +$('#form-demo').addEventListener('submit',e=>{e.preventDefault();$('#form-state').textContent='✓ Sample saved: '+$('#samplecall').value.toUpperCase()+' / '+$('#samplemode').value+'. No live submission.';$('#form-state').style.color='var(--pw-success)'}); +const rows={Users:[['N8EI','A','DMR','success','On air','18:42:07'],['W8WKY','B','D-Star','inactive','Idle','18:40:12']],Nodes:[['K8OH','A','YSF','success','Connected','18:41:00'],['W1AW','B','DMR','inactive','Idle','18:35:20']],Peers:[['XLX720','A','XLX','success','Connected','18:42:12'],['XLX123','C','XLX','warning','Pending','18:37:05']]}; +$$('[data-tab]').forEach(b=>b.addEventListener('click',()=>{$$('[data-tab]').forEach(x=>{x.classList.toggle('active',x===b);x.setAttribute('aria-pressed',String(x===b))});$('#sample-table-heading').textContent='Recently heard '+b.dataset.tab.toLowerCase();$('#sample-table-body').innerHTML=rows[b.dataset.tab].map(([call,mod,protocol,state,status,t])=>''+call+''+mod+''+protocol+''+status+''+t+'').join('')})); diff --git a/tokens.json b/tokens.json new file mode 100644 index 0000000..b468977 --- /dev/null +++ b/tokens.json @@ -0,0 +1,83 @@ +{ + "version": "1.0.0", + "brand": { + "carbon": "#171715", + "graphite": "#2E2E2A", + "pewter": "#B8B5AB", + "porcelain": "#F2EFE9", + "signal": "#C12735", + "signal-bright": "#D32939", + "signal-deep": "#861E28", + "amber": "#DAB16B", + "jade": "#50B39A", + "copper": "#C79A80" + }, + "light": { + "canvas": "#F2EFE9", + "surface": "#FFFCF7", + "raised": "#E1DED5", + "inset": "#F8F5EF", + "text": "#272620", + "muted": "#615F56", + "border": "#CBC7BD", + "control-border": "#817D72", + "focus": "#A52C36", + "link": "#A52C36", + "primary": "#C12735", + "on-primary": "#FFFFFF", + "primary-hover": "#A51F2C", + "primary-active": "#861E28", + "firefly": "#8A5D20", + "on-firefly": "#FFFFFF", + "firefly-hover": "#704A17", + "firefly-active": "#593B13", + "success": "#186950", + "success-bg": "#DFEDE6", + "warning": "#785018", + "warning-bg": "#EEE5D3", + "danger": "#A52C36", + "danger-bg": "#F2DDDD", + "info": "#615F56", + "info-bg": "#E7E4DC", + "inactive": "#615F56", + "selection": "#EFD8D7", + "on-selection": "#272620", + "hover": "#EEEAE1", + "disabled": "#77736A", + "disabled-bg": "#E7E3DA" + }, + "dark": { + "canvas": "#171715", + "surface": "#22221F", + "raised": "#2E2E2A", + "inset": "#141412", + "text": "#E8E6DF", + "muted": "#ADA99F", + "border": "#484840", + "control-border": "#7A7971", + "focus": "#DAB16B", + "link": "#D8D4C9", + "primary": "#C12735", + "on-primary": "#FFFFFF", + "primary-hover": "#D32939", + "primary-active": "#A82330", + "firefly": "#DAB16B", + "on-firefly": "#171715", + "firefly-hover": "#E6C28A", + "firefly-active": "#C39955", + "success": "#50B39A", + "success-bg": "#1C332D", + "warning": "#DAB16B", + "warning-bg": "#352C1D", + "danger": "#F1989C", + "danger-bg": "#3C2225", + "info": "#B8B5AB", + "info-bg": "#30302C", + "inactive": "#ADA99F", + "selection": "#48272A", + "on-selection": "#E8E6DF", + "hover": "#30302C", + "disabled": "#918E85", + "disabled-bg": "#30302C" + } +} diff --git a/tools/build_tokens.py b/tools/build_tokens.py new file mode 100644 index 0000000..d6c46cc --- /dev/null +++ b/tools/build_tokens.py @@ -0,0 +1,75 @@ +from pathlib import Path +import json +root=Path(__file__).resolve().parents[1] +brand={'carbon':'#171715','graphite':'#2E2E2A','pewter':'#B8B5AB','porcelain':'#F2EFE9','signal':'#C12735','signal-bright':'#D32939','signal-deep':'#861E28','amber':'#DAB16B','jade':'#50B39A','copper':'#C79A80'} +light={'canvas':'#F2EFE9','surface':'#FFFCF7','raised':'#E1DED5','inset':'#F8F5EF','text':'#272620','muted':'#615F56','border':'#CBC7BD','control-border':'#817D72','focus':'#A52C36','link':'#A52C36','primary':'#C12735','on-primary':'#FFFFFF','primary-hover':'#A51F2C','primary-active':'#861E28','firefly':'#8A5D20','on-firefly':'#FFFFFF','firefly-hover':'#704A17','firefly-active':'#593B13','success':'#186950','success-bg':'#DFEDE6','warning':'#785018','warning-bg':'#EEE5D3','danger':'#A52C36','danger-bg':'#F2DDDD','info':'#615F56','info-bg':'#E7E4DC','inactive':'#615F56','selection':'#EFD8D7','on-selection':'#272620','hover':'#EEEAE1','disabled':'#77736A','disabled-bg':'#E7E3DA'} +dark={'canvas':'#171715','surface':'#22221F','raised':'#2E2E2A','inset':'#141412','text':'#E8E6DF','muted':'#ADA99F','border':'#484840','control-border':'#7A7971','focus':'#DAB16B','link':'#D8D4C9','primary':'#C12735','on-primary':'#FFFFFF','primary-hover':'#D32939','primary-active':'#A82330','firefly':'#DAB16B','on-firefly':'#171715','firefly-hover':'#E6C28A','firefly-active':'#C39955','success':'#50B39A','success-bg':'#1C332D','warning':'#DAB16B','warning-bg':'#352C1D','danger':'#F1989C','danger-bg':'#3C2225','info':'#B8B5AB','info-bg':'#30302C','inactive':'#ADA99F','selection':'#48272A','on-selection':'#E8E6DF','hover':'#30302C','disabled':'#918E85','disabled-bg':'#30302C'} +# Deep brand red remains graphic or filled-control color, not small dark-mode text. +def rgb(h):return ', '.join(str(int(h[i:i+2],16)) for i in (1,3,5)) +def vals(d):return '\n'.join(f' --pw-{k}: {v};\n --pw-{k}-rgb: {rgb(v)};' for k,v in d.items()) +def block(sel,d,mode):return f'{sel} {{\n color-scheme: {mode};\n{vals(d)}\n}}\n' +base='''/* Packet Warriors / Carbon & Signal v1.0. Framework-independent tokens. */ +:root { +'''+vals({'brand-'+k:v for k,v in brand.items()})+''' + --pw-font: "IBM Plex Sans", system-ui, sans-serif; + --pw-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace; + --pw-size-xs: .8125rem; + --pw-size-sm: .875rem; + --pw-size-base: 1rem; + --pw-size-lg: 1.125rem; + --pw-size-xl: 1.375rem; + --pw-size-2xl: 1.75rem; + --pw-size-3xl: 2.25rem; + --pw-space-1: .25rem; + --pw-space-2: .5rem; + --pw-space-3: .75rem; + --pw-space-4: 1rem; + --pw-space-5: 1.5rem; + --pw-space-6: 2rem; + --pw-radius: 4px; + --pw-radius-panel: 6px; + --pw-control-height: 2.5rem; + --pw-focus-width: 2px; + --pw-action: var(--pw-primary); + --pw-on-action: var(--pw-on-primary); + --pw-action-hover: var(--pw-primary-hover); + --pw-action-active: var(--pw-primary-active); + --pw-action-rgb: var(--pw-primary-rgb); + --pw-product-mark: var(--pw-brand-signal); +} +''' +base+=block(':root, [data-pw-theme="light"], [data-bs-theme="light"], [data-md-color-scheme="default"]',light,'light') +base+=block('[data-pw-theme="dark"], [data-bs-theme="dark"], [data-md-color-scheme="slate"]',dark,'dark') +base+='@media (prefers-color-scheme: dark) {\n'+block(':root:not([data-pw-theme]):not([data-bs-theme]):not([data-md-color-scheme]), [data-pw-theme="auto"]',dark,'dark')+'}\n' +base+=''' +[data-pw-product="firefly"] { + --pw-action: var(--pw-firefly); + --pw-on-action: var(--pw-on-firefly); + --pw-action-hover: var(--pw-firefly-hover); + --pw-action-active: var(--pw-firefly-active); + --pw-action-rgb: var(--pw-firefly-rgb); + --pw-product-mark: var(--pw-firefly); +} +''' +(root/'css/pw-tokens.css').write_text(base) +(root/'tokens.json').write_text(json.dumps({'version':'1.0.0','brand':brand,'light':light,'dark':dark},indent=2)+'\n') +def luminance(s): + rgb=[int(s[i:i+2],16)/255 for i in (1,3,5)] + return sum(w*(v/12.92 if v<=.04045 else ((v+.055)/1.055)**2.4) for w,v in zip([.2126,.7152,.0722],rgb)) +def ratio(a,b): + hi,lo=sorted([luminance(a),luminance(b)],reverse=True) + return (hi+.05)/(lo+.05) +report=['# Contrast checks','', 'Calculated WCAG relative-luminance contrast ratios for selected token pairs. Normal text target 4.5:1; control borders/focus target 3:1. This is not full accessibility certification.','','| Mode | Foreground | Background | Ratio | Target | Result |','|---|---|---|---:|---:|---|'] +fails=[] +for mode,d in [('light',light),('dark',dark)]: + pairs=[(f,b,4.5) for f in ['text','muted','link','success','warning','danger'] for b in ['canvas','surface','raised']] + pairs += [(f,f+'-bg',4.5) for f in ['success','warning','danger','info']] + pairs += [('on-primary',b,4.5) for b in ['primary','primary-hover','primary-active']] + pairs += [('on-firefly',b,4.5) for b in ['firefly','firefly-hover','firefly-active']] + pairs += [(f,b,3) for f in ['control-border','focus'] for b in ['canvas','surface','raised','inset']] + for f,b,target in pairs: + r=ratio(d[f],d[b]); passed=r>=target + report.append(f'| {mode} | {f} | {b} | {r:.2f}:1 | {target}:1 | {"PASS" if passed else "FAIL"} |') + if not passed: fails.append((mode,f,b,round(r,2))) +(root/'contrast.md').write_text('\n'.join(report)+'\n') +print('Contrast failures:',fails) diff --git a/zensical/zensical.toml b/zensical/zensical.toml new file mode 100644 index 0000000..58549ce --- /dev/null +++ b/zensical/zensical.toml @@ -0,0 +1,27 @@ +# Merge into existing configuration; preserve your nav, plugins and other settings. +[project] +site_name = "Packet Warriors" +extra_css = ["stylesheets/pw-tokens.css", "stylesheets/pw-fonts.css", "stylesheets/pw-zensical.css"] +[project.theme] +font = false + +[[project.theme.palette]] +media = "(prefers-color-scheme)" +toggle.icon = "lucide/sun-moon" +toggle.name = "Switch to light mode" + +[[project.theme.palette]] +media = "(prefers-color-scheme: light)" +scheme = "default" +primary = "custom" +accent = "custom" +toggle.icon = "lucide/sun" +toggle.name = "Switch to dark mode" + +[[project.theme.palette]] +media = "(prefers-color-scheme: dark)" +scheme = "slate" +primary = "custom" +accent = "custom" +toggle.icon = "lucide/moon" +toggle.name = "Switch to system preference" -- cgit v1.2.3