Re: [community-group] [RFC] Format specification (#1)

> ### On Value Types
> @mirisuzanne and @blackfalcon I'm also curious about the various types we'd have. I know there are other aspects of the spec being worked on in different modules: Color, Space, Typography, etc. I would imagine they'll be opinionated about the formats of those different values, but I think it's worth discussing here as well.
> 
> In thinking about values is there a "best base" value type that exists in each category? A simple example to get the conversation going:
> 
> For color, there's HEX, but there's also RGBa. A color may be more accurately represented in RGBa than with HEX. If the token value was stored as an RGBa, the HEX could be derived from RGBa (with the loss of the alpha value), but the inverse is not true.
> 
> Some consumers may not support the alpha value, but token authors may want to supply it.
> 
> I'm also ideating out loud, but in a way it's a bit like progressive enhancement. My example color token has the alpha value for consumers that can use it, but for others a simpler HEX can be derived.
> 
> Now zoom out from the specifics of color, but think to space (px, rem, em, in, cm?), and typography (px, rem, em, pt) and any others. Are there specific units of measure or representations that serve as the "best base" for the token value?

This is an issue I am currently dealing with while trying to extract and convert tokens from a design tool to code. 

With a  missing unit value the only option is to supply many values as strings which makes them potentially harder to work with.

Think about something like `123.54874%` if you wanted to round it you would need to convert it again. 

The same goes when specifying `rem` or `em` which can make a huge different in the output but is not discernible without a unit `.75` could be `em` or `rem`. 

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


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

Received on Monday, 21 September 2020 10:07:25 UTC