Skip to content

json output: missing modes in referenced tokens #285

@rganko

Description

@rganko

Having two modes for primitives collection ("Mode 1", "Mode 2"), I can see only one of defined modes for other collection, that uses primitives as reference.

Current exported json output:

  "primitives": {
    "mode 1": {
      "basic": {
        "01": {
          "type": "color",
          "value": "#fbfcfdff",
          "blendMode": "normal"
        }
      }
    },
    "mode 2": {
      "basic": {
        "01": {
          "type": "color",
          "value": "#ffffffff",
          "blendMode": "normal"
        }
      }
    }
  },
  "tokens": {
    "bg": {
      "default": {
        "type": "color",
        "value": "{primitives.mode 2.basic.01}"
      }
    }
  }
}```

Notive that `tokens.bg.default` reffers to `primitives.basic.01`.
Notice also, that path includes mode name `{primitives.mode 2.basic.01}` (it did not in previous version).

Since there is mode name in the token's value path now, I was expecting two entries for each `primitive's` mode.

In this scenario output json might look like:

```{
  "primitives": {
    "mode 1": {   ...    },
    "mode 2": {   ...    }
  },
  "tokens": {
     "mode 1": {
        "bg": {
          "default": {
             "type": "color",
             "value": "{primitives.mode 1.basic.01}"
           }
        }
     },
     "mode 2": {
        "bg": {
          "default": {
             "type": "color",
             "value": "{primitives.mode 2.basic.01}"
           }
        }
     },
  }
}```

Should I expect mode name in the value's path?

P.S. Is there a plan for dealing with spaces in mode's names, like "mode 1"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions