Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement and document new design tokens #171

Closed
3 tasks done
with-heart opened this issue Dec 16, 2021 · 2 comments · Fixed by #188
Closed
3 tasks done

Implement and document new design tokens #171

with-heart opened this issue Dec 16, 2021 · 2 comments · Fixed by #188

Comments

@with-heart
Copy link
Member

with-heart commented Dec 16, 2021

This is an umbrella issue for tracking the work required to implement and document the tokens for the new design system.

Design tokens are design decisions, represented as data, that ensure systematically unified and cohesive product experiences.

See the "Design Tokens" page of the Adobe Spectrum docs for a more detailed explanation.

This issue covers the following tokens:

As we come to agreement on the changes required for each token, a new issue will be created for each token containing all of the information a contributor will need to implement the token.

By the time we close this issue, we'll be left with a usable implementation of the tokens along with Storybook documentation for each!

Definition of done

This section describes what it means for a token to be implemented and documented.

  • Update our Chakra theme with the new token
  • Document the new token in Storybook
  • Update existing components/designs to use the new tokens

Update our Chakra theme with the new token

One of the major benefits of Chakra is that its components are themeable. This means that we can modify our theme object with token changes and then use them throughout our Chakra-based components.

For example, adding a new color looks like this:

import {extendTheme} from '@chakra-ui/react'

export const theme = extendTheme({
  colors: {
    newColor: {
      100: '#fff',
      200: '#ddd',
      300: '#bbb',
      400: '#999',
      500: '#777',
      600: '#555',
      700: '#333',
      800: '#111',
      900: '#000',
    }
  }
})

Assuming this theme is passed to the ChakraProvider component, we now have access to the new color anywhere we can use a color-based prop:

<Text color="newColor.100" bg="newColor.900">Text with a new color</Text>

We'll need to make a similar effort for each token so that we can use it throughout our Chakra system.

Document the new token in Storybook

A new Storybook stories page should be created for each token. The page should serve as documentation of the new token so that contributors can understand the token by viewing this page.

For example, with the new color tokens, a Storybook page should be created to display the colors in a similar manner to the Figma colors grid:

image

Update existing components/designs to use the new tokens

Where it makes sense, existing components and page designs should be updated to use the new token.

@wchamberlain89
Copy link

Our Figma colors grid represents the full spectrum of colors for the Developer Dao design system. Our project currently is only using about 8 - 12 of these colors, Do we still want to implement the full range of colors in our system?

@wchamberlain89
Copy link

The full list I suppose lets us build aliases around the ones we're using. So we'd be able to narrow down the list later if we'd like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants