{"id":13482714,"url":"https://github.com/remarkablemark/inline-style-parser","last_synced_at":"2025-10-24T10:20:24.442Z","repository":{"id":50273539,"uuid":"192817386","full_name":"remarkablemark/inline-style-parser","owner":"remarkablemark","description":"📝 Inline style parser.","archived":false,"fork":false,"pushed_at":"2025-04-02T06:58:17.000Z","size":1994,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T07:33:42.903Z","etag":null,"topics":["css","inline-style","inline-style-parser","javascript","nodejs","npm","parse","parser","style"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/inline-style-parser","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/remarkablemark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["remarkablemark"],"patreon":"remarkablemark","open_collective":null,"ko_fi":"remarkablemark","tidelift":null,"community_bridge":null,"liberapay":"remarkablemark","issuehunt":null,"otechie":null,"thanks_dev":"u/gh/remarkablemark","custom":["https://b.remarkabl.org/teespring"]}},"created_at":"2019-06-19T23:31:34.000Z","updated_at":"2025-04-02T06:58:19.000Z","dependencies_parsed_at":"2023-11-06T07:24:46.518Z","dependency_job_id":"4877e115-964f-4480-9013-7cd0f695ca26","html_url":"https://github.com/remarkablemark/inline-style-parser","commit_stats":{"total_commits":281,"total_committers":4,"mean_commits":70.25,"dds":"0.35943060498220636","last_synced_commit":"9bb79747782eb0c6ca653cf5868fd0bf4d7e1ade"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Finline-style-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Finline-style-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Finline-style-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Finline-style-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkablemark","download_url":"https://codeload.github.com/remarkablemark/inline-style-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249532,"owners_count":20908212,"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":["css","inline-style","inline-style-parser","javascript","nodejs","npm","parse","parser","style"],"created_at":"2024-07-31T17:01:04.791Z","updated_at":"2025-10-24T10:20:19.391Z","avatar_url":"https://github.com/remarkablemark.png","language":"JavaScript","funding_links":["https://github.com/sponsors/remarkablemark","https://patreon.com/remarkablemark","https://ko-fi.com/remarkablemark","https://liberapay.com/remarkablemark","https://thanks.dev/u/gh/remarkablemark","https://b.remarkabl.org/teespring"],"categories":["JavaScript"],"sub_categories":[],"readme":"# inline-style-parser\n\n[![NPM](https://nodei.co/npm/inline-style-parser.png)](https://nodei.co/npm/inline-style-parser/)\n\n[![NPM version](https://badgen.net/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)\n[![Bundlephobia minified + gzip](https://badgen.net/bundlephobia/minzip/inline-style-parser)](https://bundlephobia.com/package/inline-style-parser)\n[![build](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/remarkablemark/inline-style-parser/branch/master/graph/badge.svg?token=B8EEK5709W)](https://codecov.io/gh/remarkablemark/inline-style-parser)\n[![NPM downloads](https://badgen.net/npm/dm/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)\n\nInline style parser copied from [`css/lib/parse/index.js`](https://github.com/reworkcss/css/blob/v2.2.4/lib/parse/index.js):\n\n```\nInlineStyleParser(string)\n```\n\nExample:\n\n```js\nconst parse = require('inline-style-parser');\n\nparse('color: #BADA55;');\n```\n\nOutput:\n\n```js\n[ { type: 'declaration',\n    property: 'color',\n    value: '#BADA55',\n    position: Position { start: [Object], end: [Object], source: undefined } } ]\n```\n\n[JSFiddle](https://jsfiddle.net/remarkablemark/hcxbpwq8/) | [Replit](https://replit.com/@remarkablemark/inline-style-parser) | [Examples](https://github.com/remarkablemark/inline-style-parser/tree/master/examples)\n\n## Installation\n\n[NPM](https://www.npmjs.com/package/inline-style-parser):\n\n```sh\nnpm install inline-style-parser --save\n```\n\n[Yarn](https://yarnpkg.com/package/inline-style-parser):\n\n```sh\nyarn add inline-style-parser\n```\n\n[CDN](https://unpkg.com/inline-style-parser/):\n\n```html\n\u003cscript src=\"https://unpkg.com/inline-style-parser@latest/dist/inline-style-parser.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  window.InlineStyleParser(/* string */);\n\u003c/script\u003e\n```\n\n## Usage\n\nImport with ES Modules:\n\n```js\nimport parse from 'inline-style-parser';\n```\n\nOr require with CommonJS:\n\n```js\nconst parse = require('inline-style-parser');\n```\n\nParse single declaration:\n\n```js\nparse('left: 0');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'left',\n    value: '0',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 8 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse multiple declarations:\n\n```js\nparse('left: 0; right: 100px;');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'left',\n    value: '0',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 8 },\n      source: undefined\n    }\n  },\n  {\n    type: 'declaration',\n    property: 'right',\n    value: '100px',\n    position: {\n      start: { line: 1, column: 10 },\n      end: { line: 1, column: 22 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse declaration with missing value:\n\n```js\nparse('top:');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'top',\n    value: '',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 5 },\n      source: undefined\n    }\n  }\n]\n```\n\nParse unknown declaration:\n\n```js\nparse('answer: 42;');\n```\n\nOutput:\n\n```js\n[\n  {\n    type: 'declaration',\n    property: 'answer',\n    value: '42',\n    position: {\n      start: { line: 1, column: 1 },\n      end: { line: 1, column: 11 },\n      source: undefined\n    }\n  }\n]\n```\n\nInvalid declarations:\n\n```js\nparse('');      // []\nparse();        // throws TypeError\nparse(1);       // throws TypeError\nparse('width'); // throws Error\nparse('/*');    // throws Error\n```\n\n## Testing\n\nRun tests:\n\n```sh\nnpm test\n```\n\nRun tests in watch mode:\n\n```sh\nnpm run test:watch\n```\n\nRun tests with coverage:\n\n```sh\nnpm run test:coverage\n```\n\nRun tests in CI mode:\n\n```sh\nnpm run test:ci\n```\n\nLint files:\n\n```sh\nnpm run lint\n```\n\nFix lint errors:\n\n```sh\nnpm run lint:fix\n```\n\n## Release\n\nRelease and publish are automated by [Release Please](https://github.com/googleapis/release-please).\n\n## License\n\n[MIT](https://github.com/remarkablemark/inline-style-parser/blob/master/LICENSE). See the [license](https://github.com/reworkcss/css/blob/v2.2.4/LICENSE) from the original project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Finline-style-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkablemark%2Finline-style-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Finline-style-parser/lists"}