A Scoped Token Constant (STC) is a locally defined string or template literal that contains one or more Tailwind utility classes or token references. It is scoped to the module or component and is intended to improve DRYness, semantic reuse and readability of className values within JSX/TSX files.
STCs are recognized by Sentinel as a legal styling construct alongside NSOs. They are most useful when;
STCs were introduced to address styling needs that;
They complement, but do not replace, NSOs.
const FORM_BUTTON = "min-w-[320px]";
used in
2. Template Literal
3. Composed with cn()
Rule | Description |
Semantic naming | Constants must be named clearly, with UPPER_SNAKE_CASE or camelCase depending on scope |
DRY scope | Should represent a meaningful reusable pattern, not a one-off |
Tailwind tokens only | STCs may contain Tailwind utilities, token references (e.g. min-w-[…], var(–…)), or theme(…) values |
JS-only | STCs are for use in .ts, .tsx or .js files — not in .css or .nso.ts blocks |
Optional nesting | May be combined using cn() or template literals for dynamic styling needs |
Never replace NSOs | Use an NSO when structure, reviewability or grouping is required |
Feature | STC | NSO |
Local reuse | ✅ | ❌ (global) |
File-based style block | ❌ | ✅ |
Grouped by property | ❌ | ✅ |
ClassName-driven | ✅ | ❌ |
Token compatible | ✅ | ✅ |
Reviewable structure | ⚠️ | ✅ |
Composition (cn()) | ✅ | ❌ |
Construct | Reviewable? | Why |
NSOs | ✅ Fully reviewable | File-based, named, grouped by property, formatted with comments and spacing |
STCs | ⚠️ Partially reviewable | Often defined as local string constants; no grouping, no enforced structure, not always semantically named |
⚠️ The Warning Means:
STCs are technically readable but not self-describing.
They are not structured by design — and therefore do not meet Sentinel’s full review clarity standard.
For example:
const FORM_BUTTON = "min-w-[320px]";
✅ It’s DRY and reused.
❌ But a reviewer doesn’t know if it includes spacing, interaction, or visual decoration.
❌ There’s no grouping, no spacing, and no audit trail.
It must be reviewed where it is used, not on its own terms.
.form-button {
/* 1. Layout */
min-width: 320px;
/* 4. Spacing */
padding: theme(spacing.3);
}
A reviewer sees exactly what it governs, grouped and sorted.
⚠️ STCs are legal but informal.
They improve developer experience and DRYness, but they don’t replace structured, reviewable styles like NSOs.
You can use STCs freely — just don’t confuse code convenience with style governance.
While Scoped Token Constants (STCs) improve clarity and reuse within a module, they lack formal structure and cannot be audited independently. STCs are not grouped by canonical property, do not include comment headings or spacing, and offer no guarantee of semantic scope. They are reviewable only in context, not in isolation — and should never be mistaken for full styling contracts.
Use STCs for local DRYness, not system governance.