20.9.0 • Published 5 years ago

cultureamp-style-guide v20.9.0

Weekly downloads
6
License
MIT
Repository
github
Last release
5 years ago

STATUS: DEPRECATED AND UNMAINTAINED

This repo is no longer in use and Pull Requests will not be accepted. Please use the new Kaizen Component Library. All components from this repo have been migrated across.

Kaizen

Culture Amp’s Component Library and Living Style Guide

Visit the living style guide at http://www.cultureamp.design.

Contributing

This library is maintained by Culture Amp's Front End Capability Team, but contributions are welcome from anyone.

See CONTRIBUTING.md for more information.

Using components in your project

Because our components are styled with CSS Modules, consuming them in your project isn’t as simple as you might expect. If you simply imported pre-compiled components from an NPM package, you’d either get the styles for those components embedded in the compiled JavaScript, which is not how we prefer to deliver our stylesheets, or you would have to import the compiled components and their compiled styles separately.

To provide a simpler developer experience, this package exposes a Webpack configuration decorator, which makes the source JavaScript modules for the components (complete with their references to their CSS modules, SVG symbols, etc.) available to the host project's Webpack build.

Decorate your Webpack config, passing your ExtractTextPlugin instance into the decorator for it to use to output CSS:

const decorateWithStyleGuide = require('cultureamp-style-guide/webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

const extractTextPlugin = new ExtractTextPlugin({
  filename: '[name]-[hash].bundle.css'
});

const webpackConfig = {
  ⋮
  module: {
    rules: [
      ⋮,
      {
        test: /\.scss$/,
        use: extractTextPlugin.extract({
          ⋮
        }),
      }
    ],
  },
  plugins: [
    ⋮
    extractTextPlugin,
  ],
};

module.exports = decorateWithStyleGuide(webpackConfig, {
  // Pass your ExtractTextPlugin instance to the decorator
  extractTextPlugin: extractTextPlugin
});

Importing React Components

React components may be imported from the cultureamp-style-guide module, and then used in other React components. Their stylesheets and SVG dependencies will be imported automatically thanks to the Webpack configuration decorator above.

import React from 'react';
import Icon from 'cultureamp-style-guide/components/Icon/Icon';

export default function MyComponent(props) {
  return (
    <div>
      <Icon />
    </div>
  );
}

Warning: You might be tempted to try importing multiple components like this:

import { Icon, Card } from 'cultureamp-style-guide/components';

The Culture Amp Style Guide does not support this (the components directory does not contain an index.js) because Webpack does not support eliminating the unused components from this type of import. See webpack/webpack#2867 for many examples of people struggling with this.

Changelog

You can view the release history from the Releases page on Github.

For release history pre-dating 12.4.3, you can see the old CHANGELOG.md.

Ownership

cultureamp-style-guide is maintained by the Front End Capability Team at Culture Amp (#team_front_end in #camp_amplify).


1You should use NVM to install automatically the version of NodeJS specified in .nvmrc, and consider using nvm-auto to switch to it automatically when working in this project.

20.9.0

5 years ago

20.8.0

5 years ago

20.7.0

5 years ago

20.6.0

5 years ago

20.5.2

5 years ago

20.5.1

5 years ago

20.5.0

5 years ago

20.4.2

5 years ago

20.4.1

5 years ago

20.4.0

5 years ago

20.3.2

5 years ago

20.3.1

5 years ago

20.3.0

5 years ago

20.2.1

5 years ago

20.2.0

5 years ago

20.1.1

5 years ago

20.1.0

5 years ago

20.0.2

5 years ago

20.0.1

5 years ago

20.0.0

5 years ago

19.2.3

5 years ago

19.2.2

5 years ago

19.2.1

5 years ago

19.2.0

5 years ago

19.1.0

5 years ago

19.0.2

5 years ago

19.0.1

5 years ago

19.0.0

5 years ago

18.4.2

5 years ago

18.4.1

5 years ago

18.4.0

5 years ago

18.3.0

5 years ago

18.2.0

5 years ago

18.1.2

5 years ago

18.1.1

5 years ago

18.1.0

5 years ago

18.0.0

5 years ago

17.3.0

5 years ago

17.2.0

5 years ago

17.1.3

5 years ago

17.1.2

5 years ago

17.1.1

5 years ago

17.1.0

5 years ago

17.0.0

5 years ago

16.4.3

5 years ago

16.4.2

6 years ago

16.4.1

6 years ago

16.4.0

6 years ago

16.3.1

6 years ago

16.3.0

6 years ago

16.2.1

6 years ago

16.2.0

6 years ago

16.1.0

6 years ago

16.0.0

6 years ago

15.4.0

6 years ago

15.3.0

6 years ago

15.2.2

6 years ago

15.2.1

6 years ago

15.2.0

6 years ago

15.1.0

6 years ago

15.0.0

6 years ago

14.6.1

6 years ago

14.6.0

6 years ago

14.5.1

6 years ago

14.5.0

6 years ago

14.4.0

6 years ago

14.3.2

6 years ago

14.3.1

6 years ago

14.3.0

6 years ago

14.2.0

6 years ago

14.1.1

6 years ago

14.1.0

6 years ago

14.0.0

6 years ago

13.2.0

6 years ago

13.1.0

6 years ago

13.0.2

6 years ago

13.0.1

6 years ago

13.0.0

6 years ago

12.7.1

6 years ago

12.7.0

6 years ago

12.6.0

6 years ago

12.5.1

6 years ago

12.5.0

6 years ago

12.4.3

6 years ago

12.4.2

6 years ago

12.4.1

6 years ago

12.4.0

6 years ago

12.3.0

6 years ago

12.2.0

6 years ago

12.1.0

6 years ago

12.0.5

6 years ago

12.0.4

6 years ago

12.0.3

6 years ago

12.0.2

6 years ago

12.0.1

6 years ago

12.0.0

6 years ago

11.2.1

6 years ago

11.2.0

6 years ago

11.1.0

6 years ago

11.0.0

6 years ago

10.3.0

6 years ago

10.2.0

6 years ago

10.1.1

6 years ago

10.1.0

6 years ago

10.0.2

6 years ago

10.0.1

6 years ago

10.0.0

6 years ago

9.0.2

6 years ago

9.0.1

6 years ago

9.0.0

6 years ago

8.0.0

6 years ago

7.1.0

6 years ago

7.0.0

6 years ago

6.0.0

6 years ago

5.1.6

6 years ago

5.1.5

6 years ago

5.1.4

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.2.0

6 years ago

4.1.5

6 years ago

4.1.4

6 years ago

4.1.3

6 years ago

4.1.2

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.2

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago