$ cnpm install gatsby-interface
Storybook available at gatsby-interface.netlify.com:
Using npm:
npm install gatsby-interface --save
Using Yarn:
yarn add gatsby-interface
Certain Gatsby Interface components require the Futura PT
webfont. These files are git-ignored to prevent the unauthorized release of licensed assets, and are not included in this repository.
Gatsby Inc. employees can download these fonts from our Google Drive. Put all those folders in src/assets/futura-pt
and you should be good to go!
git clone https://github.com/gatsby-inc/gatsby-interface.git
.yarn
.yarn storybook
.If you want to add a new component to gatsby-interface
, run yarn scaffold:component
to create stubs:
yarn scaffold:component MyNewComponent
This script will do the following:
MyNewComponent
directory for the component at ./src/components
MyNewComponent.tsx
, with stubs for props type, styles and even some variantsMyNewComponent.stories.tsx
, which follows the suggestions from Component Checklist proposal.index.ts
, which reexports everything from the component file./src/index.ts
and ./index-ts-only.ts
.Everything that is generated should be working out of the box and be ready to shipped (though please avoid shipping the stubs ????)
These are some patterns and best practices we use when contributing to gatsby-interface
:
gatsby-design-tokens
for styling constants: https://www.gatsbyjs.org/guidelines/design-tokens/.dev
branch.TONE
and VARIANT
prop (when appropriate) to definie color style and variant of a component — see e. g. <Button>
.skeletons
folder provide only the functionality, but no styles, and can be used within other components.To run the visual testing tool, run CHROMATIC_APP_CODE=<insert_app_code> yarn chromatic
You can find the app code in the Chromatic dashboard - https://www.chromaticqa.com
Gatsby is dedicated to building a welcoming, diverse, safe community. We expect everyone participating in the Gatsby community to abide by our Code of Conduct. Please read it. Please follow it. In the Gatsby community, we work hard to build each other up and create amazing things together. ????????
Copyright 2013 - present © cnpmjs.org