Re: [community-group] [RFC] Theming (#2)

This is a great discussion. I'd like to throw in a few more thoughts on the definition of "themes". In my experience the word is used to express different concepts so it's worth being specific.

A lot of the time theme is used to refer to brand expression (applying a color palette to UI). Dark Mode support across platforms adds a second dimension to this since a UI palette can now have two different manifestations in light and dark mode.

Then there is the wider concept of layouts responding to other conditions defined by device attributes (pixel density, screen size, inout/output mode, etc.), user context (attention level, motor skills, vision, etc.) and environment (location, time of day, etc.). This last group is probably better labeled "contexts" rather than themes but can impact the values of Tokens if supported.

I'm wondering if the brand expression / UI color use case maybe doesn't need a solution in tokens since that can be expressed in the values assigned to the tokens. For the other use cases you could see a "context" concept in tokens that could look something like

context {
  name = "brightness"
  description = "A context to toggle light/dark mode"
  options = ["light_mode", "dark_mode"]
  default = "light_mode"
}

context {
  name = "legibility"
  description = "a11y context to make text easier to read"
  options = ["standard", "high"]
  default = "standard"
}

The tokens could then reference this with something like (making up syntax here, not a proposal)

component.heading-1.color = dark_grey
component.heading-1.color[brightness=dark_mode] = light_grey
component.heading-1.color[legibility=high] = black
component.heading-1.color[legibility=high, brightness=dark_mode] = white


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

Received on Wednesday, 2 October 2019 05:01:23 UTC