tachyons-generator
This repo is currently under active development. It isn't currently ready for production, but we hope to have a beta out soon. Pull requests and issues welcome! If you'd like to lend a hand but don't know where to start please ping @johnotander ❤️.
Generate a custom Tachyons build with a json configuration. Inspiration from this tachyons issue.
Installation
npm i -S tachyons-generator
Or, use a curl request to generate css and docs
curl -X POST \ -H "Content-Type: application/json" \ -d '{"typeScale": [5,4,3,2,1,0.5] }' \ https://tachyons.pub
or post the config.json file
curl -X POST \ -H "Content-Type: application/json" \ -d @config.json \ https://tachyons.pub
Usage
This will generate an index.html file with the generated style guide as well as a static css file.
const fs = const tachyonsGenerator = const config = const generate = async { const tachy = const out = await tachy fs fs fs}
Example config
"typeScale": 3 225 15 125 1 0875 "spacing": 25 5 1 2 4 8 16 "lineHeight": 1 125 15 "customMedia": "m": 48 "l": 64 "xl": 128 "colors": "black": "#000" "near-black": "#111" "dark-gray": "#333" "mid-gray": "#555" "gray": "#777" "silver": "#999" "light-silver": "#aaa" "moon-gray": "#ccc" "light-gray": "#eee" "near-white": "#f4f4f4" "white": "#fff" "dark-red": "#f00008" "red": "#ff3223" "orange": "#f3a801" "gold": "#f2c800" "yellow": "#ffde37" "purple": "#7d5da9" "light-purple": "#8d4f92" "hot-pink": "#d62288" "dark-pink": "#c64774" "pink": "#f49cc8" "dark-green": "#006C71" "green": "#41D69F" "navy": "#001b44" "dark-blue": "#00449e" "blue": "#357edd" "light-blue": "#96ccff" "lightest-blue": "#cdecff" "washed-blue": "#f6fffe" "washed-green": "#e8fdf5" "washed-yellow": "#fff8d5" "light-pink": "#efa4b8" "light-yellow": "#f3dd70" "light-red": "#ffd3c0" "nested": "links": "blue" "light-blue" "borderWidths": 0 0125 025 05 1 2 "borderRadius": 0 0125 025 05 1 "widths": 1 2 4 8 16 "maxWidths": 1 2 4 8 16 32 48 64 96 "heights": 1 2 4 8 16 "tables": "striped": "light-silver" "moon-gray" "light-gray" "near-white" "stripe": "light" "dark" "typography": "measure": 30 34 20 "opacity": 1 09 08 07 06 05 04 03 02 01 005 0025 0
You can also omit the partials you don't need with the key skipModules
, for example if you don't want normalize.css in the bundle you can do:
"skipModules": "normalize"
Example npm commands
You can automate the generation and publishing using something like this pattern
"start": "npm run build && npm run publish",
"build": "node index.js",
"publish": "curl -X POST -H 'Content-Type: application/json' -d @config.json https://tachyons.pub"
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by John Otander (@4lpine).
This package was initially generated with yeoman and the p generator.