Code Monkey home page Code Monkey logo

constructicon's Introduction

Constructicon Build status npm

A collection of common patterns used across many Professional Services projects.

The aim of this library is to provide a toolbelt of components, that will allow us to compose sites together more quickly and consistently.

Style Guide

We are building this with a living style guide to showcase how to use the various components, using React Styleguidist.

The styleguide will be publicly available at https://everydayhero.github.io/constructicon

While developing, it is useful to serve the styleguide using yarn start, which will hot reload changes as you develop.

Theming and Flexibility

One of the main challenges is providing the required flexibility.

The TraitsProvider component allows us to set our own themes and defaults.

We can manage the look of most components via various props, and even have custom styles injected into them via the styles prop.

Upgrading from 0.* to v1.0

A few breaking changes were introduced in 1.0.0 that need to be considered on the following components:

  • Container

    Changes from styles object (e.g. styles = { ... }) to use nested keys, e.g.

    {
      root: { ... },
      outer: { ... }
    }
    
  • Modal

    Removed nested styles object weirdness. So instead of:

    {
      wrapper: {
        content: { ... },
        overlay: { ... }
      },
      container: { ... },
      close: { ... }
    }
    

    It is now:

    {
      content: { ... },
      overlay: { ... },
      container: { ... },
      close: { ... }
    }
    
  • Form

    Change styles.form to styles.root for consistency.

  • ProgressBar

    Change styles.background to styles.root for consistency.

Upgrading to v2

Constructicon now uses Emotion as it's CSS in JS solution. There are a few small things you will need to do to ensure your CSS is compatible.

  • Any child CSS selectors are required to be prefixed with an & e.g. '& > div', &:hover
  • Define your keyframes in their own object and pass them into withStyles, which will then pass your computed keyframes back to your styles function e.g. see components/icon/styles.js
  • If you are using your own renderDocument function, renderServerCSS is now a function that takes your server rendered string of HTML, and returns an updated HTML string with the required styles inlined in the markup

Development

Scripts

  • yarn to install dependencies
  • yarn start to generate and serve style guide
  • yarn test to run tests (linting and unit tests)
  • yarn run test:lint to run linting
  • yarn run test:unit to run unit tests
  • yarn run build to build for production
  • yarn run build:styleguide to build the styleguide

Tests

We are aiming to build from the ground up with tests where appropriate, using Mocha, Chai and Enzyme.

To execute the tests, simply run yarn test.

constructicon's People

Contributors

danhenderson avatar rowanhogan avatar ellsclytn avatar johnpmorris avatar olivierpichon avatar mickitron avatar lukebrooker avatar benoneal avatar

Stargazers

Evgenii Bykov avatar

Watchers

James Cloos avatar Alexander avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.