{
  "antiPatterns": [
    "Consuming ref values as CSS variables.",
    "Using a decorative border as the only control boundary.",
    "Using the Tailwind v3 opacity modifier with variable-backed colors."
  ],
  "api": {
    "importPath": "@ancrel/tokens",
    "symbols": [
      "Theme",
      "Density",
      "THEMES",
      "DENSITIES",
      "DEFAULT_CONTEXT",
      "SysTokenPath",
      "CompTokenPath",
      "cssVar",
      "cssVarName",
      "TokenIndexEntry",
      "tokenIndex"
    ],
    "typeRef": "api/tokens/index.d.ts"
  },
  "constraints": [
    "Import the token CSS once and scope a subtree with data-theme and data-density.",
    "Use sys.border.control for an identifiable control boundary. Pair status color with a label or shape."
  ],
  "docs": "raw/frontend/tokens.md",
  "examples": [
    {
      "code": "'use client'\n\nimport { useState } from 'react'\nimport { cssVar, type Theme } from '@ancrel/tokens'\nimport '@ancrel/tokens/css'\n\nconst panel = {\n  backgroundColor: cssVar('sys.surface.panel'),\n  color: cssVar('sys.ink.primary'),\n  padding: cssVar('sys.space.inset'),\n  fontFamily: cssVar('sys.type.family.sans'),\n}\n\nexport default function App() {\n  const [theme, setTheme] = useState<Theme>('dark')\n  return (\n    <section aria-label=\"Workspace\" data-theme=\"light\" data-density=\"comfortable\" style={panel}>\n      <h2>Workspace</h2>\n      <section aria-label=\"Local preview\" data-theme={theme} data-density=\"compact\" style={panel}>\n        <h3>Local preview</h3>\n        <p>Preview theme: {theme}</p>\n        <button type=\"button\" onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>\n          Switch preview theme\n        </button>\n      </section>\n    </section>\n  )\n}\n",
      "command": "pnpm test",
      "entry": "examples/fe.tokens/App.tsx",
      "fixture": "examples/fe.tokens/",
      "id": "minimal"
    }
  ],
  "id": "fe.tokens",
  "kind": "design-tokens",
  "language": "typescript",
  "layer": "frontend",
  "owner": "frontend-infra",
  "package": {
    "ecosystem": "npm",
    "name": "@ancrel/tokens",
    "version": "0.2.0"
  },
  "provenance": {
    "mode": "original",
    "origin": "Ancrel",
    "references": [
      {
        "commit": "4cc384c3bdbd09a3a50268adf81ba23f53aac93e",
        "note": "Theme roles, control states and compact spacing.",
        "path": "frontend/src/index.css",
        "repo": "rule-studio"
      },
      {
        "commit": "4cc384c3bdbd09a3a50268adf81ba23f53aac93e",
        "note": "Class-based theme selection and Tailwind integration.",
        "path": "frontend/tailwind.config.js",
        "repo": "rule-studio"
      }
    ]
  },
  "schemaVersion": 1,
  "stability": "experimental",
  "summary": "Scoped semantic design tokens for dark and light themes at compact and comfortable densities."
}
