{"id":13394387,"url":"https://github.com/tachyons-css/generator","last_synced_at":"2025-04-06T10:14:42.002Z","repository":{"id":45552928,"uuid":"68321236","full_name":"tachyons-css/generator","owner":"tachyons-css","description":"Generate a custom Tachyons build from a config file","archived":false,"fork":false,"pushed_at":"2023-06-13T15:24:17.000Z","size":1033,"stargazers_count":314,"open_issues_count":23,"forks_count":35,"subscribers_count":24,"default_branch":"main","last_synced_at":"2024-05-12T05:02:55.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://components.ai/tachyons-theme","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tachyons-css.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-15T18:40:26.000Z","updated_at":"2024-02-01T00:33:11.000Z","dependencies_parsed_at":"2022-09-13T23:22:36.443Z","dependency_job_id":"6245f027-c76f-40da-aeb7-2124d69181b9","html_url":"https://github.com/tachyons-css/generator","commit_stats":null,"previous_names":["tachyons-css/tachyons-generator"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons-css%2Fgenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons-css%2Fgenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons-css%2Fgenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tachyons-css%2Fgenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tachyons-css","download_url":"https://codeload.github.com/tachyons-css/generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464226,"owners_count":20942970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:01:17.794Z","updated_at":"2025-04-06T10:14:41.978Z","avatar_url":"https://github.com/tachyons-css.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# tachyons-generator [![Build Status](https://secure.travis-ci.org/tachyons-css/tachyons-generator.svg?branch=master)](https://travis-ci.org/tachyons-css/tachyons-generator) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\nThis repo is currently under active development.\nIt isn't currently ready for production, but we hope to have a beta out soon.\nPull requests and issues welcome!\nIf you'd like to lend a hand but don't know where to start please ping @johnotander :heart:.\n\nGenerate a custom Tachyons build with a json configuration.\nInspiration from [this tachyons issue](https://github.com/tachyons-css/tachyons/issues/224).\n\n## Installation\n\n```bash\nnpm i -S tachyons-generator\n```\n\nOr, use a curl request to generate css and docs\n\n```sh\ncurl -X POST \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"typeScale\": [5,4,3,2,1,0.5] }' \\\n     https://tachyons.pub/api\n```\n\nor post the config.json file\n\n```sh\ncurl -X POST \\\n     -H \"Content-Type: application/json\" \\\n     -d @config.json \\\n     https://tachyons.pub/api\n```\n\n## Usage\nThis will generate an index.html file with the generated style guide as well as a static css file.\n\n```javascript\nconst fs = require('fs')\n\nconst tachyonsGenerator = require('tachyons-generator')\nconst config = require('./config.json')\n\nconst generate = async () =\u003e {\n  const tachy = tachyonsGenerator(config)\n\n  const out = await tachy.generate()\n\n  fs.writeFileSync('index.html', out.docs)\n  fs.writeFileSync('tachyons.css', out.css)\n  fs.writeFileSync('tachyons.min.css', out.min)\n}\n\ngenerate()\n```\n\n#### Example config\n\n```js\n{\n  \"typeScale\": [\n    3, 2.25, 1.5, 1.25, 1, 0.875\n  ],\n  \"spacing\": [.25, .5, 1, 2, 4, 8, 16],\n  \"lineHeight\": [1, 1.25, 1.5],\n  \"customMedia\": [\n    { \"m\": 48 },\n    { \"l\": 64 },\n    { \"xl\": 128 }\n  ],\n  \"colors\": {\n    \"black\": \"#000\",\n    \"near-black\": \"#111\",\n    \"dark-gray\": \"#333\",\n    \"mid-gray\": \"#555\",\n    \"gray\": \"#777\",\n    \"silver\": \"#999\",\n    \"light-silver\": \"#aaa\",\n    \"moon-gray\": \"#ccc\",\n    \"light-gray\": \"#eee\",\n    \"near-white\": \"#f4f4f4\",\n    \"white\": \"#fff\",\n    \"dark-red\": \"#f00008\",\n    \"red\": \"#ff3223\",\n    \"orange\": \"#f3a801\",\n    \"gold\": \"#f2c800\",\n    \"yellow\": \"#ffde37\",\n    \"purple\": \"#7d5da9\",\n    \"light-purple\": \"#8d4f92\",\n    \"hot-pink\": \"#d62288\",\n    \"dark-pink\": \"#c64774\",\n    \"pink\": \"#f49cc8\",\n    \"dark-green\": \"#006C71\",\n    \"green\": \"#41D69F\",\n    \"navy\": \"#001b44\",\n    \"dark-blue\": \"#00449e\",\n    \"blue\": \"#357edd\",\n    \"light-blue\": \"#96ccff\",\n    \"lightest-blue\": \"#cdecff\",\n    \"washed-blue\": \"#f6fffe\",\n    \"washed-green\": \"#e8fdf5\",\n    \"washed-yellow\": \"#fff8d5\",\n    \"light-pink\": \"#efa4b8\",\n    \"light-yellow\": \"#f3dd70\",\n    \"light-red\": \"#ffd3c0\"\n  },\n  \"nested\": {\n    \"links\": [\"blue\", \"light-blue\"]\n  },\n  \"borderWidths\": [0, 0.125, 0.25, 0.5, 1, 2],\n  \"borderRadius\": [0, 0.125, 0.25, 0.5, 1],\n  \"widths\": [1, 2, 4, 8, 16],\n  \"maxWidths\": [1, 2, 4, 8, 16, 32, 48, 64, 96],\n  \"heights\": [1, 2, 4, 8, 16],\n  \"tables\": {\n    \"striped\": [\"light-silver\", \"moon-gray\", \"light-gray\", \"near-white\"],\n    \"stripe\": [\"light\", \"dark\"]\n  },\n  \"typography\":{\n    \"measure\": [30, 34, 20]\n  },\n  \"opacity\": [1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.05, 0.025, 0]\n}\n```\n\nYou 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:\n\n```js\n{\n  \"skipModules\": [\"normalize\"]\n}\n```\n\n#### Example npm commands\nYou can automate the generation and publishing using something like this pattern\n```\n  \"start\": \"npm run build \u0026\u0026 npm run publish\",\n  \"build\": \"node index.js\",\n  \"publish\": \"curl -X POST -H 'Content-Type: application/json' -d @config.json  https://tachyons.pub/api\"\n```\n\n\n## License\n\nMIT\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n---\n\nCrafted with \u003c3 by John Otander ([@4lpine](https://twitter.com/4lpine)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachyons-css%2Fgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftachyons-css%2Fgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftachyons-css%2Fgenerator/lists"}