Skip to main content

shared-ui

Canonical design tokens for The New Masses design system (see Design_Philosophy.md at the repo root). tokens.css is the source of truth for the :root custom-property block; artifice-ocr, artifice-draft, and artifice-transcribe each currently declare an identical copy of these tokens at the top of their own static/css/app.css. Consolidating those three call sites to @import or <link> this file instead of redeclaring the literals is the intended next step, not done as part of the directory reorganization.

artifice-graph was consolidated into this file first (2026-07): its app-local tokens.css had accumulated 30 tokens (shadows, radius, spacing, motion, layout, --font-mono) that shared-ui was simply missing, plus the @media (prefers-color-scheme: dark) block — without which this file could only respond to an explicit [data-theme] and never follow the OS. It also carried one naming drift (--font-sans → renamed to the already-canonical --font-label) and two dead/out-of-scope token families that were removed or relocated rather than promoted:

  • --w-* ("Word-Status Colours (Reading View)") — deleted outright. ArtificeGraph has no reading view; this was copy-paste residue.
  • --reg-* (register taxonomy) and --type-* (entity-type accents) — ArtificeGraph domain vocabulary, not suite-wide identity. These now live in apps/artifice-graph/web/static/entity-colors.css, loaded after this file.

artifice-graph no longer keeps a copy at all. Its web/static/tokens.css was deleted; web/server.py resolves assets through the installed package via importlib.resources, so the app serves this file rather than a mirror of it. There is nothing to keep in sync, and no per-app tokens.css should be reintroduced.

# apps/artifice-graph/src/artifice_graph/web/server.py
import importlib.resources
import shared_ui

_SHARED_UI = importlib.resources.files(shared_ui) / "assets"
app.mount("/shared", StaticFiles(directory=str(_SHARED_UI)), name="shared")
<link rel="stylesheet" href="/shared/tokens.css?v={{ asset_v }}" />

Load this before any stylesheet that consumes the variables, and before an app's own domain colours (e.g. entity-colors.css).

Adopt the same mount when consolidating the remaining three apps.

Fonts (2026-07)

shared_ui/assets/fonts/ and shared_ui/assets/fonts.css vendor the three type families named in Design_Philosophy.md §3 (Playfair Display, Libre Baskerville, Archivo) so that no app fetches them from fonts.googleapis.com / fonts.gstatic.com at runtime — a hard requirement of the suite's local-first, offline guarantee. fonts.css declares @font-face rules with url()s relative to fonts/; it is a sibling file to tokens.css in shared_ui/assets/ rather than folded into it, because it performs asset loading (network/file fetches) while tokens.css only declares custom properties — different concern, kept in a different file so each can be reasoned about (and diffed) independently.

shared_ui/assets/fonts/PlayfairDisplay(.ttf|-Italic.ttf) and shared_ui/assets/fonts/LibreBaskerville(.ttf|-Italic.ttf) are copies of the files already vendored at apps/artifice-ocr/assets/fonts/ — copied, not moved, since that app's own asset pipeline may reference its copy. Both are variable fonts (a single file's wght axis spans the full weight range each family needs), so fonts.css uses one @font-face rule per style with a font-weight range rather than one rule per static weight.

shared_ui/assets/fonts/Archivo.woff2 was fetched fresh (the OCR app does not carry Archivo) directly from Google's CDN, already in woff2 format.

Format note: woff2 is preferred (roughly half the size of TTF, and what every supported browser wants), but only Archivo ships as woff2. Converting the two variable TTFs to woff2 requires fonttools' woff2 support, which itself requires the brotli Python extension — neither brotli nor a standalone woff2_compress binary was available in this environment, and per project instruction no conversion tooling was installed to manufacture one. Playfair Display and Libre Baskerville therefore ship as TTF. Revisit if brotli becomes available (e.g. as a project dependency for another reason) — conversion is then a single fonttools ttLib.woff2 compress call per file.

Licence: all three families are SIL Open Font License 1.1. The licence text is vendored per-family — shared_ui/assets/fonts/OFL-Archivo.txt, shared_ui/assets/fonts/OFL-PlayfairDisplay.txt, shared_ui/assets/fonts/OFL-LibreBaskerville.txt — rather than merged into one file, because each carries a distinct copyright holder in its header and this repository is heading toward a Zenodo DOI / JOSS review where that attribution needs to stay traceable to its source.

Metadata

Release files for artifice-shared-ui 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for artifice-shared-ui 0.4.0
File Size Uploaded
artifice_shared_ui-0.4.0.tar.gz 773.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for artifice-shared-ui 0.4.0
File Interpreter ABI Platform
artifice_shared_ui-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / artifice_shared_ui-0.4.0.tar.gz

Download URL artifice_shared_ui-0.4.0.tar.gz
Size 773.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f39331d2eb98647c18b94db0aca19ab5634ce80c8ee649332ee872cb98c731c3
BLAKE2b-256 checksum
How to use checksums
f2f2411414f34fd98e8010bd522c45416c00c7ac9e153b67e7b22c5cdfba7631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / artifice_shared_ui-0.4.0-py3-none-any.whl

Download URL artifice_shared_ui-0.4.0-py3-none-any.whl
Size 776.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7323cef2809b337927f687d7823d4dd4cc007d509f091567d79d34f17d5ac052
BLAKE2b-256 checksum
How to use checksums
579e3fdbd25e9d05d406fa2b10e357dbbfe247eec61da8d2aa3ec235fc47000a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page