Components
Hoppin Design SystemReading ListThe Hoppin Design System is based on:TODO / DiscussionPhilosophySetupReading List
Tokens

Get Started

The Hoppin Design System is based on:

  • Styled-System for token-based theming
  • Styled-Components for CSS-in-JS (see below)

TODO / Discussion

  • styled-components forward all props to the rendered HTML (using a simple whitelist) resulting in lots of warnings in the console and bad HTML.
  • do we want to use something like Reakit for accessibility?

Philosophy

A design system is a collection of reusable components, guided by clear standards, that can be assembled together to build any number of applications.

Goal to be as useful as Shopify Polaris or Atlasian AtlasKit:

  • simple onboarding (intro, get started, philosophy, tooling, ...)

  • tokens (variables)

    • token names reflect intention/meaning, not it's visual style (~min 10 in video)
      • hoppinTurquoise => brandPrimary
      • red => danger
  • components with docs on props, usage, best practices

Guiding principles for components:

  • Keep layout separate

    • Design components to only care about itself, not the layout. So say a box should always fill it's container with flex-grow: 1
  • Respond to context

    • e.g. colors not hardcoded, currentColor
    • for us: don't use pink, turqoise, etc. use brandPrimary, brandAccent, etc.
  • Document Assumptions

    • for us: use PropTypes or TypeScript, add inline doc comments explaining props.

Setup

  • Independent Repo, later npm module

  • All apps depend on design-system module

  • co-locate component and examples?

    • folder structure like:

      • components
        • Button
          • index.js - all the exports
          • Button.js - component
          • Button.md or readme.md (examples for design-system)
    • inline jsdoc comments for props, etc

Reading List

Some interesting inputs came form: