Skip to content

Commit

Permalink
feat: Add utils css build (#1075)
Browse files Browse the repository at this point in the history
feat: Add utils css build
  • Loading branch information
gregorylegarec authored Jun 28, 2019
2 parents e215bfc + 84df3a2 commit 7d16152
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ import 'cozy-ui/transpiled/react/stylesheet.css'

You're now ready to use [Cozy UI's (p)React components](https://docs.cozy.io/cozy-ui/react/)

### Utility classes

React components only come with the needed style, nothing more, but you may need some more utility classes to build your apps.

To do so you have at your disposal a special CSS build `cozy-ui.utils.min.css` that you can add like this:

```
import 'cozy-ui/dist/cozy-ui.utils.min.css'
```

### As a vanilla CSS library

The entire library is also available as a good ol’ CSS library. You can simply add it to your app by linking the distributed minified file.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"homepage": "https://github.com/cozy/cozy-ui",
"scripts": {
"build:css": "env CSSMODULES=false stylus -c --include stylus -o dist/cozy-ui.min.css stylus/cozy-ui/build.styl --use ./node_modules/autoprefixer-stylus --with \"{ browsers: ['last 2 versions'] }\"",
"build:css:utils": "env CSSMODULES=false stylus -c --include stylus -o dist/cozy-ui.utils.min.css stylus/cozy-ui/utils.styl --use ./node_modules/autoprefixer-stylus --with \"{ browsers: ['last 2 versions'] }\"",
"build:css:app": "env CSSMODULES=false stylus -c --include stylus -o build/styleguide/app.css stylus/cozy-ui/build.styl --use ./node_modules/autoprefixer-stylus --with \"{ browsers: ['last 2 versions'] }\"",
"build:doc": "npm-run-all 'build:doc:*'",
"build:doc:config": "copyfiles -u 1 docs/*.md docs/_config.yml build",
Expand All @@ -29,6 +30,7 @@
"lint:stylus": "stylint stylus --config .stylintrc",
"palette": "scripts/make-palette.sh",
"prebuild:css": "mkdir -p dist/ && stylus -C node_modules/normalize.css/normalize.css node_modules/normalize.css/normalize.styl",
"prebuild:css:utils": "mkdir -p dist/",
"prebuild:css:app": "mkdir -p build/styleguide && stylus -C node_modules/normalize.css/normalize.css node_modules/normalize.css/normalize.styl",
"prebuild:doc:kss": "run-s clean:doc:kss build:css:app",
"prepare": "yarn release",
Expand Down
4 changes: 4 additions & 0 deletions stylus/cozy-ui/utils.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*------------------------------------*\
CSS utility classes only
\*------------------------------------*/
@require '../utilities/*'

0 comments on commit 7d16152

Please sign in to comment.