146 lines
7.2 KiB
Markdown
146 lines
7.2 KiB
Markdown
# Contract: Web Visual Baseline
|
||
|
||
Version: 1.2
|
||
|
||
## Scope
|
||
|
||
Defines the default visual baseline for future web applications in this ecosystem.
|
||
|
||
This is the single visual style for the ecosystem. The canonical reference files are vendored
|
||
in this pattern:
|
||
|
||
- `assets/view.css`
|
||
- `assets/view.html`
|
||
- `assets/upload.html`
|
||
|
||
When a project does not already have an established design system, use this baseline by default.
|
||
Copy `assets/view.css` as the starting stylesheet and adapt tokens; do not rewrite it from prose.
|
||
|
||
Keep shared operational components in one application stylesheet loaded after the baseline.
|
||
Keep page-only rules local to that page. If a project promises a byte-for-byte baseline copy,
|
||
put all overrides in the extension stylesheet; record deliberate deviations in its local bible.
|
||
The optional `assets/operations.css` example extends `view.css`; it is not a second baseline.
|
||
|
||
## Core Direction
|
||
|
||
- Prefer a clean, data-first interface over decorative marketing UI.
|
||
- Default to server-rendered HTML with simple CSS.
|
||
- Optimize for scanability, density, and operational clarity.
|
||
- Use restrained visual hierarchy, not novelty effects.
|
||
- Reuse the baseline directly when possible; copying the canonical CSS and adapting tokens is allowed.
|
||
|
||
## Canonical Visual Language
|
||
|
||
- Dark application header on top.
|
||
- White page background and white content surfaces.
|
||
- Light secondary surfaces for headers and table heads.
|
||
- Thin gray borders with a subtle shadow.
|
||
- Small radii (`4px`).
|
||
- Dense but readable typography (`14px/1.5` baseline).
|
||
- Blue accent in the `#2185d0` family for primary actions and active accents.
|
||
- Tables and key-value layouts as the primary presentation pattern.
|
||
- Status communicated with both text and color.
|
||
|
||
## Typography
|
||
|
||
- Use `Lato, "Helvetica Neue", Arial, Helvetica, sans-serif` unless a project has an approved alternative.
|
||
- Page titles are compact and strong, not oversized hero typography.
|
||
- Section titles should be clear and structural.
|
||
- Avoid display fonts, novelty fonts, and oversized marketing headings in application UI.
|
||
|
||
## Layout Primitives
|
||
|
||
- `page-header`: dark global header with page title and compact actions.
|
||
- `page-main`: centered content area with generous outer margin and bounded max width.
|
||
- `panel`: white surface with border, light shadow, and simple heading strip.
|
||
- `section-card`: heading followed by table/content block.
|
||
- `table-wrap`: horizontal overflow container for dense data tables.
|
||
|
||
## Preferred Components
|
||
|
||
- Key-value tables for singleton object/detail views.
|
||
- Dense data tables for repeated records.
|
||
- Compact upload/open panels when local file input is needed.
|
||
- Quiet header actions for secondary navigation.
|
||
- Clear primary buttons for the main action on a screen.
|
||
- Simple alert/error boxes with border + tinted background.
|
||
|
||
## Data Formatting
|
||
|
||
- Money: no minor units (no cents/kopecks) — round to whole currency units for
|
||
display. Group thousands with a non-breaking space (` `), not a comma
|
||
or dot — e.g. `$13 320`, not `$13,320.00`. The `ru-RU` locale's own
|
||
`toLocaleString()` grouping character is already a non-breaking space, so
|
||
`Math.round(value).toLocaleString('ru-RU')` satisfies this directly without
|
||
hand-rolled grouping logic.
|
||
- Dates that only need day-level (not time-of-day) precision — a delivery
|
||
ETA, a planning/reorder date — are shown as an ISO week number: `W32`. When
|
||
a table row aggregates several dates that disagree (e.g. several purchase
|
||
lots under one order with different ETAs), show the week range instead:
|
||
`W32-34`. Audit-trail timestamps (created/updated-at) are exempt — show
|
||
those as ordinary dates, since collapsing them to a week would hide the
|
||
information they exist to convey.
|
||
- Week formatting is a display convention, not a storage format: preserve the exact date in
|
||
form values and API payloads. Date inputs may display `2026 · W40` while submitting
|
||
`2026-10-01`. Exact-date filters may retain a normal date input.
|
||
- Include the ISO week-year when a range crosses years or the year would be ambiguous.
|
||
Do not compute a cross-year range from the minimum/maximum week numbers alone.
|
||
- Compact amounts (for example `$1,2 млн`) are allowed in summary metrics. Keep full rounded
|
||
amounts in tables so values remain comparable. Distinguish a known zero from a missing value.
|
||
- Align numeric columns right and use tabular numerals. Keep short identifiers on one line;
|
||
truncate long descriptions only when the complete value is available on inspection.
|
||
|
||
## Operational Extensions
|
||
|
||
- A compact header may include build version, current ISO week, sync state and a display
|
||
privacy toggle. Keep these in normal flex flow so they cannot overlap navigation.
|
||
- Navigation uses links with `aria-current="page"`; in-page actions use buttons.
|
||
Quiet text-colored links are allowed in dense data cells, with visible hover and keyboard
|
||
focus treatment. Do not apply the quiet treatment indiscriminately to every link.
|
||
- Summary metrics may sit above tables; they supplement the records rather than replace them.
|
||
Use the baseline's small radii, surfaces and spacing.
|
||
- If row backgrounds communicate status, use opaque `--ok-bg`, `--warn-bg`, `--crit-bg`
|
||
tokens and retain an explicit status indicator. Do not stack translucent status tints.
|
||
- Optional screen-sharing privacy mode masks sensitive values in place, preserves column
|
||
geometry and headings, and uses a labeled toggle with `aria-pressed`. Persist the preference
|
||
locally and apply it to newly rendered values. This is display masking only: DOM values,
|
||
API responses and exports are not redacted or access-controlled by it.
|
||
- A discrete probability/level indicator may use filled bars plus its exact numeric value
|
||
and accessible name. This is a defined quantitative encoding, not permission for arbitrary
|
||
per-field colors. Risk status remains a separate concept; product-specific levels and
|
||
thresholds stay in the project's local bible.
|
||
|
||
## Status Rules
|
||
|
||
- `OK`: green
|
||
- `Warning`: amber
|
||
- `Critical`: red
|
||
- `Unknown`: gray
|
||
- `Empty`: light gray
|
||
|
||
Status must not rely on color alone.
|
||
Show text or another explicit indicator together with the color treatment.
|
||
|
||
## Responsive Rules
|
||
|
||
- Keep desktop density high.
|
||
- Collapse grids to one column on small screens.
|
||
- Preserve table readability with horizontal scrolling instead of destructive cardification by default.
|
||
- Header actions may wrap or stack on mobile, but should remain compact.
|
||
|
||
## Forbidden Drift
|
||
|
||
- Do not default to glassmorphism, blurred shells, floating neon gradients, or soft-dribbble styling.
|
||
- Do not replace dense tables with oversized card grids when the data is inherently tabular.
|
||
- Do not introduce arbitrary color coding for non-status fields.
|
||
- Do not use oversized border radii, heavy shadows, or large empty spacing as the default application style.
|
||
- Do not import a SPA/dashboard aesthetic unless the product explicitly requires it.
|
||
|
||
## Relationship To Other UI Contracts
|
||
|
||
- Use this contract as the visual baseline.
|
||
- Use `table-management` for shared table geometry and interaction seams.
|
||
- Use `controls-selection` for button hierarchy, filters, and bulk selection semantics.
|
||
- Use `timeline-views` for optional week-based Gantt views of the same records.
|
||
- Pattern-specific contracts may override details only when they document the reason.
|