Re: [community-group] Promote ISO standards in units representation (#159)

Thank you for raising this issue (and also opening a PR for it), @rdlopes. While I think it is generally a good idea to lean on other, suitable standards rather than re-inventing the wheel, I'm not convinced the ISO 8601 format would be appropriate in this instance.

This format is for specifying _design_ tokens, so it's primarily catering to teams and tools involved in the creation of graphical user interfaces. In that context, the primary use-case for duration tokens is animation. We expect them to be used to express durations and/or delays that get used in UI animations. It's therefore reasonable to expect the actual duration values to be quite short. Most UI animations/transitions I've seen will be fractions of a second and a few seconds at most. Duration values in the order of minutes, hours or even days are _very_ unlikely.

Furthermore, a quick sampling of tools and platforms other than CSS suggest that they often use milliseconds or seconds wherever animation durations can be set:

* [Figma's animation settings](https://help.figma.com/hc/en-us/articles/360040314193-Guide-to-prototyping-in-Figma#Create_interactions_and_animations) use millisecond values
* [Android's animation & transition APIs](https://developer.android.com/guide/topics/graphics/prop-animation) use millsecond values
* [Animations in iOS](https://www.raywenderlich.com/5304228-ios-animation-tutorial-getting-started) appear to use values in seconds

I think it's therefore reasonable to assume that UI designers, developers and other users of design tokens will be familiar with expressing durations in (milli)seconds.

I'm no expert in [ISO 8601 durations](https://en.wikipedia.org/wiki/ISO_8601#Durations), but it looks like you could express `123ms` as `PT0.123S`, so _technically_ there's no problem using it. However, considering the above, I'd argue that our current `123ms` syntax will be more readable and familiar to our intended audience than `PT0.123S`.

I realise that you're proposing to use ISO 8601 _in addition to_ the existing syntax. However, given the reasons above, I don't think it really adds any benefit to users of our format but it would add complexity to parsers and people learning the format. My preference is therefore to reject this proposal.

(If we expected people to often use much longer durations (minutes, hours, etc.), then this would be a good idea and I'd be in favour of it. But I seriously doubt people will be doing that in our format)

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


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

Received on Wednesday, 10 August 2022 07:21:57 UTC