@amsc/amsc-theme
v1.0.4
Published
AMSC brand theme for the Packets Design System — bundles @esnet/packets-ui-css with AMSC color and typography overrides into a single CSS import.
Readme
@amsc/amsc-theme
AMSC brand theme for the Packets Design System.
Bundles @esnet/packets-ui-css with AMSC color and typography overrides into a single CSS file. One install, one import — no manual token configuration required.
What it does
| Layer | What it provides |
|---|---|
| @esnet/packets-ui-css | Packets component styles (bundled inside) |
| @amsc/amsc-tokens | AMSC CSS custom properties (bundled inside) |
| src/override.css | Maps --pkts-* vars to AMSC values |
Overridden from Packets defaults:
--pkts-color-light-primary→#004573(AMSC navy)--pkts-color-core-blue-700/-500→ AMSC navy / blue-alt. Packets primary buttons, links and focus rings read the blue ramp directly at these positions (bright cyan by default), so shifting them is the only token-level way to make primary controls navy instead of teal.- Font families → Figtree (display), Roboto (sans), Roboto Mono (mono)
Left at Packets defaults (already correct): the red ramp / destructive / error roles (the AMSC and Packets red ramps are byte-identical, so red renders as AMSC red with no override), --pkts-color-light-secondary (an outline-button role in Packets 2.x, not red), tertiary, accent, and all size/spacing/motion/shadow tokens.
AMSC-only additions (not in Packets): --amsc-color-light-blue-alt, --amsc-color-light-dark-blue, --amsc-color-light-light-blue — declared by the bundled @amsc/amsc-tokens.
Installation
npm install @amsc/amsc-themeNote:
@esnet/packets-ui-cssand@amsc/amsc-tokensare bundled inside the output CSS. You do not need to install them separately.
Import the CSS
React / Vite — in your app entry file (e.g. src/main.tsx or src/index.css):
@import "@amsc/amsc-theme/dist/amsc-theme.css";Or as a JS import:
import "@amsc/amsc-theme/dist/amsc-theme.css";Plain HTML — in your <head>:
<link rel="stylesheet" href="node_modules/@amsc/amsc-theme/dist/amsc-theme.css">CDN (no npm, for Streamlit/Airflow/static sites):
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@amsc/amsc-theme@latest/dist/amsc-theme.css">Load AMSC fonts
Add to your <head> before the theme stylesheet:
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Figtree:[email protected]&family=Roboto:ital,wght@0,300..700;1,300..700&family=Roboto+Mono:ital,wght@0,300..700;1,300..700&family=Zilla+Slab:wght@400;700&display=swap"
rel="stylesheet"
/>Add the packets class
Packets requires a packets class on the root element. Add it to <body> in your index.html:
<body class="packets light">Dark mode is not yet configured. Keep
lightuntil a dark mode theme is defined.
Verifying the integration
After setup, open your app and inspect the computed styles on any element. You should see:
font-family: "Roboto", sans-serif ← AMSC override active
--pkts-color-light-primary: #004573 ← AMSC navy
--amsc-color-light-blue-alt: #00608c ← AMSC-only token availableIf you still see Signika or Source Sans 3, the theme CSS is not loading or is being overridden by a higher-specificity rule in your app's own CSS.
Conflict resolution
If your app has existing CSS that hardcodes colors or font families, those declarations will override the theme's custom property values on specific elements. Common culprits:
/* These will override the theme — replace with token references */
font-family: sans-serif; → font-family: var(--pkts-font-family-body-sans);
color: #004573; → color: var(--pkts-color-light-primary);
background-color: #A6111B; → background-color: var(--pkts-color-light-error);Follow the agent implementation guide for a pre-flight conflict report and setup checklist.
Updating Packets
@esnet/packets-ui-css is a build-time dependency of @amsc/amsc-theme. Packets updates flow in when @amsc/amsc-theme releases a new version — consumers still only need to install @amsc/amsc-theme.
To bump the Packets version:
- Update
@esnet/packets-ui-cssinpackages/amsc-theme/package.json - Run
pnpm installandpnpm run buildfrom the repo root - Verify the output, then release a new
@amsc/amsc-themeversion
Currently depends on: @esnet/[email protected]
Migration from @amsc/amsc-ui-css
@amsc/amsc-ui-css is deprecated. To migrate:
npm uninstall @amsc/amsc-ui-css
npm install @amsc/amsc-themeReplace any import of @amsc/amsc-ui-css/dist/styles.css with @amsc/amsc-theme/dist/amsc-theme.css. The visual output should be equivalent.
Token reference
| CSS custom property | Value | Source |
|---|---|---|
| --pkts-color-light-primary | #004573 | @amsc/amsc-tokens via override |
| --pkts-color-core-blue-700 | #004573 | @amsc/amsc-tokens via override (primary base/active) |
| --pkts-color-core-blue-500 | #00608C | @amsc/amsc-tokens via override (primary hover) |
| --pkts-color-light-error | #A6111B | Packets default (matches AMSC red ramp) |
| --amsc-color-light-blue-alt | #00608C | @amsc/amsc-tokens |
| --amsc-color-light-dark-blue | #112A4D | @amsc/amsc-tokens |
| --amsc-color-light-light-blue | #9CE2FF | @amsc/amsc-tokens |
| --pkts-font-family-body-sans | "Roboto" | @amsc/amsc-tokens via override |
| --pkts-font-family-body-display | "Figtree" | @amsc/amsc-tokens via override |
| --pkts-font-family-body-mono | "Roboto Mono" | @amsc/amsc-tokens via override |
For the full token list see @amsc/amsc-tokens.
Publishing
@amsc/amsc-theme is published to the public npm registry at npmjs.com/package/@amsc/amsc-theme. CI publishes via npm trusted publishing (OIDC) — no npm tokens in GitLab.
Releasing a new version
- Merge your changes to
main - Bump the version in
packages/amsc-theme/package.jsonfollowing semver:- Patch (
1.0.x) — bug fixes, no API changes - Minor (
1.x.0) — new tokens or overrides added, fully backward compatible - Major (
x.0.0) — breaking changes (e.g. renamed tokens, dropped Packets version)
- Patch (
- Commit the version bump
- Tag and push to trigger the CI publish job:
git tag amsc-theme-v<version> # e.g. amsc-theme-v1.0.1 git push origin amsc-theme-v<version> - The
publish:amsc-themeCI job publishes to npm using OIDC trusted publishing.
Questions
For publishing questions, contact Nelson Alexander — [email protected].
