From 84df3a2b8632f634b7feaef20063e915ac5b64ef Mon Sep 17 00:00:00 2001 From: GoOz Date: Thu, 27 Jun 2019 15:41:11 +0200 Subject: [PATCH] feat: Add utils css build --- docs/README.md | 10 ++++++++++ package.json | 2 ++ stylus/cozy-ui/utils.styl | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 stylus/cozy-ui/utils.styl diff --git a/docs/README.md b/docs/README.md index 860fd25b27..f80e46d8ce 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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. diff --git a/package.json b/package.json index 44dfa6da8f..4087a78741 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/stylus/cozy-ui/utils.styl b/stylus/cozy-ui/utils.styl new file mode 100644 index 0000000000..1ba128aa8e --- /dev/null +++ b/stylus/cozy-ui/utils.styl @@ -0,0 +1,4 @@ +/*------------------------------------*\ + CSS utility classes only +\*------------------------------------*/ +@require '../utilities/*'