{"id":17750579,"url":"https://github.com/nuintun/style-tokens","last_synced_at":"2025-04-01T09:39:16.311Z","repository":{"id":16360647,"uuid":"19110722","full_name":"nuintun/style-tokens","owner":"nuintun","description":"A tools can parse css text to css tokens","archived":false,"fork":false,"pushed_at":"2017-04-21T02:09:46.000Z","size":471,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-14T16:23:16.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://nuintun.github.io/style-tokens","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/nuintun.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}},"created_at":"2014-04-24T14:07:52.000Z","updated_at":"2016-10-22T22:52:13.000Z","dependencies_parsed_at":"2022-09-10T17:50:52.368Z","dependency_job_id":null,"html_url":"https://github.com/nuintun/style-tokens","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fstyle-tokens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fstyle-tokens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fstyle-tokens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fstyle-tokens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuintun","download_url":"https://codeload.github.com/nuintun/style-tokens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620132,"owners_count":20806716,"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-10-26T12:22:43.924Z","updated_at":"2025-04-01T09:39:16.276Z","avatar_url":"https://github.com/nuintun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# style-tokens\n\n\u003eA tools can parse css text to css tokens\n\u003e\n\u003e[![NPM Version][npm-image]][npm-url]\n\u003e[![Download Status][download-image]][npm-url]\n\u003e[![Travis Status][travis-image]][travis-url]\n\u003e[![Test Coverage][coveralls-image]][coveralls-url]\n\u003e[![Dependencies][david-image]][david-url]\n\n### Reference : \n\u003eModify from csso: [https://github.com/css/csso](https://github.com/css/csso)\n\n### Install\n```\n$ npm install style-tokens\n```\n\n### Introduction:\n\u003eUse:\n\n```js\nvar tokens,\n  Tokens = require('style-tokens'),\n  csstext = '/* base.css */body { color: red; }';\n\ntokens = Tokens.Parse(csstext); // parse css\n\nconsole.log(Tokens.TokenType); // all tokens's type, the value is readonly\n\nconsole.log(tokens);\n```\n\n\u003eTokens output:\n\n```js\n[\n  {\n    \"index\": 0,\n    \"type\": \"CommentML\",\n    \"value\": \"/* base.css */\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 1\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 14\n    }\n  },\n  {\n    \"index\": 1,\n    \"type\": \"Identifier\",\n    \"value\": \"body\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 15\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 18\n    }\n  },\n  {\n    \"index\": 2,\n    \"type\": \"Space\",\n    \"value\": \" \",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 19\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 19\n    }\n  },\n  {\n    \"index\": 3,\n    \"type\": \"LeftCurlyBracket\",\n    \"value\": \"{\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 20\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 20\n    },\n    \"right\": 11\n  },\n  {\n    \"index\": 4,\n    \"type\": \"Space\",\n    \"value\": \" \",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 21\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 21\n    }\n  },\n  {\n    \"index\": 5,\n    \"type\": \"Identifier\",\n    \"value\": \"color\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 22\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 26\n    }\n  },\n  {\n    \"index\": 6,\n    \"type\": \"Colon\",\n    \"value\": \":\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 27\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 27\n    }\n  },\n  {\n    \"index\": 7,\n    \"type\": \"Space\",\n    \"value\": \" \",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 28\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 28\n    }\n  },\n  {\n    \"index\": 8,\n    \"type\": \"Identifier\",\n    \"value\": \"red\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 29\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 31\n    }\n  },\n  {\n    \"index\": 9,\n    \"type\": \"Semicolon\",\n    \"value\": \";\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 32\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 32\n    }\n  },\n  {\n    \"index\": 10,\n    \"type\": \"Space\",\n    \"value\": \" \",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 33\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 33\n    }\n  },\n  {\n    \"index\": 11,\n    \"type\": \"RightCurlyBracket\",\n    \"value\": \"}\",\n    \"start\": {\n      \"line\": 1,\n      \"column\": 34\n    },\n    \"end\": {\n      \"line\": 1,\n      \"column\": 34\n    },\n    \"left\": 3\n  }\n]\n```\n\n[travis-image]: http://img.shields.io/travis/nuintun/style-tokens.svg?style=flat-square\n[travis-url]: https://travis-ci.org/nuintun/style-tokens\n[coveralls-image]: http://img.shields.io/coveralls/nuintun/style-tokens/master.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/nuintun/style-tokens?branch=master\n[david-image]: http://img.shields.io/david/nuintun/style-tokens.svg?style=flat-square\n[david-url]: https://david-dm.org/nuintun/style-tokens\n[npm-image]: http://img.shields.io/npm/v/style-tokens.svg?style=flat-square\n[npm-url]: https://www.npmjs.org/package/style-tokens\n[download-image]: http://img.shields.io/npm/dm/style-tokens.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fstyle-tokens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuintun%2Fstyle-tokens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fstyle-tokens/lists"}