Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@rickycourtes/designrail

Latest version: v0.2.2

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: rickycourtes
0 Stars
0 Forks
4 Versions
JavaScript Repo language

Scan summary

@rickycourtes/designrail was last scanned on 29 Nov 2026 at version 0.2.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions, all published within 2 days (28 and 29 Nov 2026).
  • Findings: No rules fired in version 0.2.2.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.2 LATEST 29 Nov 2026 No rules fired
0.2.1 28 Nov 2026 No rules fired
0.2.0 28 Nov 2026 No rules fired
0.0.0-stage 28 Nov 2026 Not shown

No rules fired in 0.2.2

Findings

Findings for v0.2.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

designrail

The design foundation for any web project. Every project installs it and builds on top of it, and one update to designrail reaches all of them.

designrail has two halves:

  • The foundation: a set of token names (the contract), a default theme, and a kit of parts (button, field, card, pill, dropdown, toast, sheet) that every project imports. Each project brings only its theme (its own values for those token names) and the parts no other project has. Each part has knobs (custom properties) for restyling it without editing it, and sits in a CSS cascade layer, so a project's own CSS always wins.
  • The tooling: reads a codebase's CSS, SCSS, Less, HTML, JSX/TSX, Vue, Svelte and Astro, then
    • finds the colours, spacing and parts the code repeats
    • turns them into a theme for the foundation
    • rewrites hardcoded values to tokens
    • keeps drift out with a git-aware check
    • moves a project to a new foundation version with upgrade

It needs only Node 20 and has no dependencies. It scans a 300-file app in about 100 ms, or about 10 ms from its cache.

  • Quick start
  • Building on the foundation
  • Concepts
  • Commands
  • The token contract
  • The kit
  • Design rules
  • Configuration
  • What it reads
  • CI and git hooks
  • Coding agents
  • Library API
  • Performance
  • Limits
  • Developing designrail

Quick start

npm i -D @rickycourtes/designrail   # the foundation and the tools
npx designrail init               # config (records the foundation version) + DESIGN.md
npx designrail audit              # health score and what to fix first
npx designrail extract            # your theme, from the values already in use
npx designrail fix --write        # hardcoded values → tokens
npx designrail check --install-hook   # no new drift from here on
npx designrail specimens          # a page with every token and part

On a project that already has token files, skip extract. fix and check use the tokens that are already there, plus the foundation's.

Installing

designrail is published publicly on npm as @rickycourtes/designrail, so it installs like any other package: no .npmrc or token needed.

npm i -D @rickycourtes/designrail saves a ^0.2.0 range. While the version is 0.x, a caret range takes patch releases (0.2.x) automatically through npm update. A minor release (0.3.0) may rename things, so you move to it on purpose and run designrail upgrade.

Building on the foundation

Load the foundation first, then your theme, then your own parts:

/* app.css */
@import '@rickycourtes/designrail/foundation.css';   /* default theme, base, every part (layered) */
@import './tokens/primitives.css';     /* your raw values */
@import './tokens/semantic.css';       /* the contract pointed at them: your look */
@import './ui/index.css';              /* your own parts and variants */
import { dropdowns, toast } from '@rickycourtes/designrail/foundation.js';
dropdowns();

How the layers work:

  • Layers: the foundation lives in three cascade layers, designrail.tokens, designrail.base and designrail.parts. Anything a project writes outside a layer wins over them, whatever its specificity, so :root { --accent: … } in your theme always beats the default.

  • Themes: setting the core tokens (--surface, --text, --accent, --text-on-accent, --font-ui) is enough to take over the look. Every other colour (fills, borders, muted text, hover, raised and sunken surfaces) is derived from those core tokens, so it follows any theme. Set any of them yourself to go further.

  • Variants, not edits: restyle a part through its knobs, on a class of your own:

    .btn.ink { --btn-bg: var(--text); --btn-fg: var(--surface); }

    Never .btn { background: … } where it is used: that freezes the part against foundation updates. check reports it as part-restyle. Layout where a part is used (margin, grid placement, width) is fine.

  • Ejecting: when a project truly needs its own version of a part, designrail eject <part> copies it in. That part then stops following the foundation, and upgrade names it whenever the foundation's copy has moved on.

  • Updating: npm outdated shows when a project is behind. Bump with npm i -D @rickycourtes/designrail@^0.3.0 (Dependabot can open that PR in each repo), then run designrail upgrade. It lists what changed in each version between the one you were on and the one installed (from kit/changes.json). With --write it rewrites renamed tokens and classes across the project and records the new version in designrail.config.json. Run designrail check after.

Concepts

Primitives are raw values, named for what they are: --blue-500: #3b82f6 or --space-12: 12px. Only token files read them. The exception is the --space-*, --radius-* and --font-size-* steps, because a step on a scale says all a gap needs.

Semantic tokens say what a value is for: --surface: var(--white) or --accent: var(--blue-500). Parts and pages read these. A theme (for example dark mode) re-points the semantic layer and leaves every part alone.

The contract is the set of semantic names that extract produces and that every kit part reads. A project that defines them can take any kit part as is. See The token contract.

Parts are reusable components: a button, a field, a card. The core rule is use the part we have; never draw it again. audit finds the places a part was drawn twice, and the foundation gives you one version to replace them with.

The foundation is the default theme plus the kit's parts, installed as a package and layered underneath the project. Knobs are the custom properties a part exposes (--btn-bg, --card-pad), so a project restyles it without editing it.

Drift is anything that moves away from the system: a hardcoded colour, a var() that resolves nowhere, a copy-pasted rule block. check reports it. With git it reports only the drift a change adds.

Commands

designrail <command> [dir] [flags]

dir defaults to the current folder. For trace and eject, which take other arguments, pass the folder with -C dir.

Every command takes these flags:

Flag Effect
--json One line of JSON instead of text.
--no-cache Reparse every file; read and write no cache.
--all Every hit or item, not the first few.
--help Usage.

An unknown flag exits with code 2 and an error, rather than being guessed at.

init [dir] [--agents] [--force]

Writes designrail.config.json and DESIGN.md, the project's design rules (see Design rules). If the project already has token files (stylesheets that are mostly custom properties on :root), init finds them and points tokens at them. parts is set to src/ui when there is a src/ folder, else ui. A page designrail specimens wrote (wherever --out put it) is listed under specimens. When the foundation is installed (or package.json depends on designrail), init records its version as foundation and prints the import lines.

  • --agents adds a short "Design system (designrail)" section to CLAUDE.md or AGENTS.md (whichever exists, else a new CLAUDE.md). See Coding agents.
  • --force rewrites files that already exist.
audit [dir] [--html file] [--limit n]

A 0–100 health score in five parts:

Part Points Measures
tokens 40 Design declarations (colour, spacing, radius, font size, family, shadow) that read a token instead of a literal.
colors 15 Distinct colours, and how many are near-identical (closer than colorTolerance).
scale 15 Spacing and radius values off the grid, per use.
duplication 15 Rules in identical groups, plus near-duplicate pairs.
reuse 15 Parts drawn as several class families, plus markup copied across files.

Then the details:

  • Colours: groups of near-identical colours (for example #3b82f6, #3b83f6 and #3a82f7), each of which could be one token.
  • Scales: every spacing, radius and font-size value with its count, and the spacing and radius values that sit off the grid, with file:line.
  • Families, weights, shadows, durations, z-index: every distinct value.
  • Duplicate rule blocks: selectors whose declarations are identical (.card ≡ .panel), and pairs that share most of them (60%+), with what differs. Like a copy-paste detector's minimum size, a block counts only at duplicates.minDeclarations (3) declarations, and a near pair only when it shares that many: two rules that both read font-weight: 600; color: var(--text) are a type role, and merging them would couple unrelated parts. Near-identical colours count as equal here. Show/hide state rules (display, opacity, pointer-events…) are left out, and so are rules whose selectors differ only by vendor pseudo-elements (::-webkit-slider-thumb and ::-moz-range-thumb): they can't share one selector list, since a browser drops the whole list over a pseudo-element it doesn't know.
  • Parts drawn more than one way: parts grouped by role (button, field, card, pill, dialog, toast, dropdown) and by family.
    • Inside the parts folder, each file is one part, so one family, whatever its classes are called: .field, .input, input and textarea in ui/field.css are the field part. The role comes from the file's name (field.css, value-field.css). A file whose name is no role (profile.css) is a part of its own, so its .pf-banner is not a toast.
    • A class a part file defines stays that part's wherever else it is styled: .checkout .btn restyles the button part, it is not another family.
    • Elsewhere, class names say the role and family. For example, .btn/.btn-secondary are one family while .submit-button and .cta are others, so the report suggests one part with variants.
  • Repeated markup: the same element structure (tags and classes) copied in more than one place, and the same structure repeated with different classes. Sibling repeats in a list are left out (render those from data).

Pages listed under specimens in the config show parts side by side on purpose, so they're left out of the part-family and repeated-markup checks.

--html file writes a self-contained report page to share. --limit n sets how many items each section shows (default 6).

scan [dir]

What was read and how fast: file count by type, how many came from cache, the token files found, how many design values read a token, and how many literals sit outside token files.

extract [dir] [--dry] [--force] [--out dir]

Builds a token system from the values the project already uses. It writes three files to the folder of the first tokens entry (tokens/ by default):

  • primitives.css
    • Colours: near-identical ones merge (the most used one is kept), then each is named by hue family and lightness step: --gray-200, --blue-500, --red-100, --white, --black-a20 for a colour with alpha. A pale tint is named for its hue, never as a grey.
    • Spacing and radius: values within snap px merge onto the grid (--space-12 merges 11px and 13px). An off-grid value used only once is left as a value to snap, not made a step. --radius-full covers anything at 500px and up.
    • Font sizes, families, weights, shadows, durations: named for their value (--font-size-15, --font-inter, --weight-600, --shadow-1, --duration-150).
    • Every token carries a comment with its use count and what it merged.
  • semantic.css: the contract, inferred from where each value is used:
    • --surface is the body/html background, else the most used neutral background.
    • --text is the body text colour, else the most used one that reads on the page.
    • --text-on-accent is what the project sets on accent backgrounds.
    • --accent is the most used colour that is not grey, red or green; --danger, --success and --warning are the most used red, green and amber.
    • --radius-control and --radius-card are the most used radius on button/field and card/dialog rules.
    • --font-size-body is the body size; --font-display is the family the headings use.
    • What the project never says is derived from the contract and marked /* derived */.
  • tokens.json: the same tokens as W3C Design Tokens (DTCG) JSON, for Figma plugins and Style Dictionary. Semantic tokens are written as references ({primitive.blue-500}).

If the project already has token files, extract stops and says so. --out dir writes a fresh set elsewhere, and --force overwrites. --dry prints the files instead of writing them.

Import primitives.css, then semantic.css, before your own styles. The files are yours: edit names and values freely. fix and check read whatever is there.

fix [dir] [--write] [--snap] [--limit n]

Rewrites hardcoded values as the tokens that hold them. It shows a diff (file, line, old → new) unless you pass --write.

  • Colours match within colorTolerance. When several tokens match, the pick goes:

    1. an exact match before a near one
    2. a semantic token whose job matches the property (a background gets --surface, a color gets --text, a border gets --border)
    3. a semantic token with no particular job (--accent)
    4. a primitive

    A semantic token whose job is a different property is never used, so #1a1a1a as a background never becomes --text.

  • Spacing, radius, font size: an exact pixel match within the same scale (rem converts at 16px; em is skipped). A token's scale comes from its name when the name says it (--space-*, --gap, --radius-*; --control, --icon-* and --*-h are sizes, which fix never writes), else from the properties that read it. So padding: 44px never becomes --control. With --snap, anything within snap px of a step also matches, and the diff marks it snapped. A negative margin becomes calc(var(--space-8) * -1).

  • Families, shadows, durations: an exact match.

  • Primitives: every value lands outside token files, so with semanticOnly on, fix never writes a primitive (the foundation's palette, such as --gray-950, included), only semantic tokens and the allowPrimitives steps. A colour only a primitive holds is listed as having no token.

  • Where it writes: CSS/SCSS/Less, <style> blocks, style="" attributes, styled-components and css`` templates, JSX style objects (a number like padding: 12 becomes padding: 'var(--space-12)'), and Tailwind arbitrary values (p-[12px] becomes p-[var(--space-12)]).

At the end it lists, by kind, the values no token holds. Add those to your token files, or regenerate with extract --out.

check [dir] [--staged | --base REF] [--install-hook]

The drift gate. It exits 1 if any rule set to error has a hit.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @rickycourtes/designrail

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229