Re: [community-group] Is the root node of a token tree a standard group? (#249)

This isn’t explicit, you’re right, but the root node is a group node. Any node that isn’t a token node (contains `$value`) is a group node. So any properties allowed on group are allowed at the root, and will cascade as such.

There have been some proposals to add root properties (such as `$name` to name the file), which would change this, but none are part of the spec currently.

Out of convention, though, most people don’t place anything in the root because there’s rarely any properties that make sense to apply to all tokens (`$description`, `$type`), but there’s nothing _explicitly_ preventing this. Both of your examples are valid.

Technically, too, the root node _could_ be a token if it contained `$value`. While that’s technically valid, it’s impractical, because no one has a practical use for a design system with only one token.

-- 
GitHub Notification of comment by drwpow
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/249#issuecomment-2344319339 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 11 September 2024 17:49:59 UTC