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

Figure out how to consume design tokens in client-side JS #787

Closed
1 task done
emersonthis opened this issue Jun 9, 2020 · 1 comment · Fixed by #790
Closed
1 task done

Figure out how to consume design tokens in client-side JS #787

emersonthis opened this issue Jun 9, 2020 · 1 comment · Fixed by #790
Assignees
Labels
👷 environment Setup, build tools, configuration, etc.

Comments

@emersonthis
Copy link

emersonthis commented Jun 9, 2020

Related to: #718

This issue was briefly discussed in Slack in connection with implementing different behavior for the Sky Nav at different breakpoints...

Background
Our design tokens live in centralized yaml files that are consumed by The Patterns. At the time of writing this, we are importing them into scss files. But we do not (yet) reference them directly in client-facing JavaScripts.

The tool we are currently using for abstracting tokens is Theo. However, Tyler expressed interest in this alternative as well: https://amzn.github.io/style-dictionary/#/

Def of Done

  • Ability to reference a design token variable in a client-facing JavaScript file
  • a solution for how to use em values in a JavascriptContext*

* This may be trickier than it sounds, because we're currently using fluid font sizes that scale up/down proportionally to the viewport width. So it's not as simple as multiplying by the font-size (integer) of the relevant breakpoint

@emersonthis emersonthis added the 👷 environment Setup, build tools, configuration, etc. label Jun 9, 2020
@tylersticka tylersticka self-assigned this Jun 9, 2020
@tylersticka
Copy link
Member

I'm about to submit a PR for the first "def of done."

I've removed the second point because (a) Theo has format transformations built in and (b) I don't think we'll actually need to use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👷 environment Setup, build tools, configuration, etc.
Projects
None yet
2 participants