a boilerplate css module
Last updated 2 years ago by danieltao1993 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install didi-ui 
SYNC missed versions from official npm registry.


npm version

A boilerplate css module.

Fork this and create your own reusable css module to be imported into react, deku, riot, etc... components.

Check out more css modules at cssmodul.es


CSS Modules is only compatible with camelCase. However deku and react have mappings to use normal class names.

This module has only camelCase classes so is compatible with:


npm install css-module-npm-boilerplate-webpack --save-dev


import fancyButton from 'css-module-npm-boilerplate-webpack'

The fancy button css module has a .button and a color style .blue, .green or .red.

Add the classes to your elements to use the styles...

css modules

	return (
        <button className={styles.button + ' ' + styles.blue }>press me</button>

react / deku css modules

	return (
        <button styleName='button blue'>press me</button>


Check out an example of using this css module here

Run it

cd example; npm install; npm start


This version uses webpack to bundle the lib button.css module.

For a minimal example of a css module without building with webpack use css-module-npm-boilerplate

The \src folder is for development.

To build to \lib run:

npm run build

This compiles to fancyButton.css bundle in lib, as we do not expect all users to have the autoprefixer, postcss and postcss-modules-values plugins, they should be able to import the module as just plain css from the \lib so we compile it before publishing.



Current Tags

  • 1.0.6                                ...           latest (2 years ago)

5 Versions

  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (7)
Dev Dependencies (13)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |