Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Document limitations of tokens passed to stitches #493

Description

@smhutch

Bug report

Not exactly a bug with stitches, but more of a limitation of css variables.

Describe the bug

Certain token keys create invalid css variables tokens. For example:

const theme = {
  colors: {
    test: "black", // ✅ works, of couse
    "test-test": "black", // ✅ works
    test_test: "black", // ✅ works
    "test.test": "black", // ❌ breaks
    "test/test": "black" // ❌ breaks
  },

For cases which break, the CSS variables created look something like: var(--colors-test)/test

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Sandbox
  2. Check dev tools for divs with white backgrounds

Expected behavior

Support any string as a token key, or warn when an invalid one is used.

Screenshots

n/a. See Sandbox

System information

  • OS: macOs
  • Browser (if applies): n/a
  • Version of Stitches: 0.1-canary.20
  • Version of Node.js: 14

Additional context

This certainly might be won't fix issue. In my case I hoped to use this structure: test/test because our design tokens are also used in other places (Figma), and we hoped to keep them identical in code and design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions