community-group icon indicating copy to clipboard operation
community-group copied to clipboard

Be explicit about whether or not empty groups are allowed

Open c1rrus opened this issue 1 year ago • 5 comments

Currently, the spec says nothing about whether or not groups can be empty - i.e. not contain any tokens or nested groups.

I've always assumed they can be empty. But I recently discovered that Cobalt UI has taken the opposite view and throws an error when it encounters an empy group.

The spec doesn't say anything, so neither view is right or wrong.

I propose we take a stance on this and be explicit in the spec. Otherwise, differing interpretations will lead to interoperability issues between tools.

My vote would be to permit empty groups. While they may seem useless they also do no harm. It's something that teams may legitimately encounter while (re-)organising their tokens and working with work-in-progress DTCG files (that's how I encountered that scenario anyway).

c1rrus avatar Mar 04 '24 16:03 c1rrus

Empty groups can be placeholders, I've used one as an alias for the default set with no modification, also for planned future updates. Wouldn't want it to throw an error.

On Mon, 4 Mar 2024 at 22:27, James Nash @.***> wrote:

Currently, the spec says nothing about whether or not groups can be empty

  • i.e. not contain any tokens or nested groups.

I've always assumed they can be empty. But I recently discovered that Cobalt UI has taken the opposite view https://github.com/drwpow/cobalt-ui/issues/206 and throws an error when it encounters an empy group.

The spec doesn't say anything, so neither view is right or wrong.

I propose we take a stance on this and be explicit in the spec. Otherwise, differing interpretations will lead to interoperability issues between tools.

My vote would be to permit empty groups. While they may seem useless they also do no harm. It's something that teams may legitimately encounter while (re-)organising their tokens and working with work-in-progress DTCG files (that's how I encountered that scenario anyway).

— Reply to this email directly, view it on GitHub https://github.com/design-tokens/community-group/issues/235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKS36FEZC7WXDONU2GAPBTYWSRWLAVCNFSM6AAAAABEFR7TS2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DOMZQHAYDANA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nesquarx avatar Mar 04 '24 17:03 nesquarx

@c1rrus Note that the Cobalt UI issue you've referenced has since been updated, they now do allow empty groups.

eins78 avatar Mar 05 '24 17:03 eins78

I'm ok with empty groups as long as we specify that they can/should be ignored when parsing.

ilikescience avatar May 01 '24 15:05 ilikescience

Should empty token groups be kept when importing/exporting by token management tooling vendors like Tokens Studio, Zeroheight, Figma, or Knapsack?

(my hunch is yes)

When exporting to other formats (say, CSS), then it's probably up to the tool to do what they think is the best decision based on the language.

kaelig avatar May 02 '24 22:05 kaelig

Tools could simply implement empty group warning, just like CSS linters warns you about "Do not use empty rulesets".

danosek avatar May 30 '24 11:05 danosek