Skip to content
SlashClone
Made by@brandkit

Brand tokens export

@brandkit/brand-tokens-export

Turn the tokens in your brand.md into code: CSS variables, a Tailwind theme (v3 and v4), and a design-tokens.json for Figma token plugins. One source of truth, regenerated in a second whenever the brand changes.

SkillContentv1.0.0 (latest)Tested
Activity
New: be the first to try it
  1. 1{
  2. 2 "name": "brand-tokens-export",
  3. 3 "owner": "brandkit",
  4. 4 "version": "1.0.0",
  5. 5 "type": "skill",
  6. 6 "description": "Turn the tokens in your brand.md into code: CSS variables, a Tailwind theme (v3 and v4), and a design-tokens.json for Figma token plugins. One source of truth, regenerated in a second whenever the brand changes.",
  7. 7 "category": "content",
  8. 8 "license": "MIT",
  9. 9 "compat": ["claude-code"],
  10. 10 "permissions": {
  11. 11 "shell": ["node scripts/export-tokens.mjs"],
  12. 12 "files": {
  13. 13 "read": ["./brand.md", "./docs/brand.md"],
  14. 14 "write": ["./brand-tokens/**"]
  15. 15 }
  16. 16 },
  17. 17 "tests": {
  18. 18 "cases": [
  19. 19 {
  20. 20 "name": "exports a YAML tokens block to CSS, Tailwind, and DTCG JSON",
  21. 21 "inputs": {
  22. 22 "brand.md": "# Test brand\n\n```yaml tokens\nname: Testco\ncolor:\n primary: \"#1F7A5C\"\n accent: \"#F2A541\"\nfont:\n heading: [Fraunces, Georgia, serif]\n mono: [JetBrains Mono, monospace]\ntext:\n base: 16px\nspace:\n \"2\": 8px\nradius:\n md: 10px\n```\n"
  23. 23 },
  24. 24 "checks": [
  25. 25 {
  26. 26 "type": "command_exits_zero",
  27. 27 "command": "node scripts/export-tokens.mjs brand.md brand-tokens"
  28. 28 },
  29. 29 { "type": "file_contains", "path": "brand-tokens/tokens.css", "text": "--color-primary: #1F7A5C;" },
  30. 30 {
  31. 31 "type": "file_contains",
  32. 32 "path": "brand-tokens/tokens.css",
  33. 33 "text": "--font-mono: \"JetBrains Mono\", monospace;"
  34. 34 },
  35. 35 { "type": "file_contains", "path": "brand-tokens/theme.css", "text": "@theme {" },
  36. 36 { "type": "file_contains", "path": "brand-tokens/tailwind.theme.cjs", "text": "\"fontFamily\"" },
  37. 37 {
  38. 38 "type": "output_matches_schema",
  39. 39 "path": "brand-tokens/design-tokens.json",
  40. 40 "schema": {
  41. 41 "type": "object",
  42. 42 "required": ["color", "font", "text", "space", "radius"],
  43. 43 "properties": {
  44. 44 "color": {
  45. 45 "type": "object",
  46. 46 "required": ["primary", "accent"],
  47. 47 "properties": {
  48. 48 "primary": {
  49. 49 "type": "object",
  50. 50 "properties": { "$value": { "const": "#1F7A5C" }, "$type": { "const": "color" } }
  51. 51 }
  52. 52 }
  53. 53 },
  54. 54 "font": {
  55. 55 "type": "object",
  56. 56 "properties": {
  57. 57 "heading": {
  58. 58 "type": "object",
  59. 59 "properties": { "$value": { "const": ["Fraunces", "Georgia", "serif"] } }
  60. 60 }
  61. 61 }
  62. 62 }
  63. 63 }
  64. 64 }
  65. 65 }
  66. 66 ]
  67. 67 },
  68. 68 {
  69. 69 "name": "reads a JSON tokens block and the bundled example",
  70. 70 "inputs": {
  71. 71 "docs/brand.md": "# Brand\n\n```json\n{ \"colors\": { \"ink\": \"#111111\" }, \"spacing\": { \"sm\": \"4px\" } }\n```\n"
  72. 72 },
  73. 73 "checks": [
  74. 74 {
  75. 75 "type": "command_exits_zero",
  76. 76 "command": "node scripts/export-tokens.mjs docs/brand.md brand-tokens"
  77. 77 },
  78. 78 { "type": "file_contains", "path": "brand-tokens/tokens.css", "text": "--color-ink: #111111;" },
  79. 79 { "type": "file_contains", "path": "brand-tokens/tokens.css", "text": "--spacing-sm: 4px;" },
  80. 80 {
  81. 81 "type": "command_exits_zero",
  82. 82 "command": "node scripts/export-tokens.mjs examples/brand.md brand-tokens/example"
  83. 83 },
  84. 84 { "type": "file_contains", "path": "brand-tokens/example/theme.css", "text": "--shadow-card: 0 1px 3px rgba(27, 31, 35, 0.12);" }
  85. 85 ]
  86. 86 }
  87. 87 ]
  88. 88 }