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

feat(forma-36-tokens): Added JS export of all tokens with TS typings #78

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

suevalov
Copy link
Contributor

@suevalov suevalov commented Feb 10, 2019

Purpose of PR

Adds index.js and index.d.ts generation for forma-36-tokens so tokens can be used in any CSS-in-JS library.

For example:

import styled from 'styled-components';
import tokens from '@contentful/forma-36-tokens';

const Item = styled.div`
   margin-top: ${tokens.spacingXl};
   color: ${tokens.colorGreenLight};
`;

All tokens are exported in a flat object with camelCase notation, which is more natural for JS and is more convenient to use with TS.

PR Checklist

  • I have read the relevant readme.md file(s)
  • All commits follow our Git commit message convention
  • Tests are not required
  • Tests are passing
  • Storybook stories are not required
  • Usage notes are updated
  • Has been tested based on Contentful's browser support
  • Doesn't contain any sensitive information

Copy link
Contributor

@m10l m10l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

@wichniowski wichniowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@suevalov suevalov merged commit c14b903 into master Feb 11, 2019
@suevalov suevalov deleted the generate-js-tokens branch February 11, 2019 12:54
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 this pull request may close these issues.

None yet

3 participants