{"id":24983646,"url":"https://github.com/posthtml/posthtml-style-to-file","last_synced_at":"2025-07-05T03:32:59.348Z","repository":{"id":57328834,"uuid":"43177750","full_name":"posthtml/posthtml-style-to-file","owner":"posthtml","description":"Save DOM styles to CSS file","archived":false,"fork":false,"pushed_at":"2019-06-25T12:10:42.000Z","size":13,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T21:06:07.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/posthtml.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":"2015-09-25T22:08:15.000Z","updated_at":"2024-01-31T08:08:54.000Z","dependencies_parsed_at":"2022-09-13T06:02:49.716Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-style-to-file","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-style-to-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-style-to-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-style-to-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-style-to-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-style-to-file/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480512,"owners_count":21110936,"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":"2025-02-04T09:19:59.485Z","updated_at":"2025-04-11T20:51:37.309Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"[![NPM][npm]][npm-url]\n[![Deps][deps]][deps-url]\n[![Tests][travis]][travis-url]\n[![Coverage][cover]][cover-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"220\" height=\"150\" title=\"PostHTML\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n  \u003cimg width=\"180\" height=\"150\" title=\"CSS\"           src=\"https://worldvectorlogo.com/logos/css3.svg\"\u003e\n  \u003ch1\u003eStyle-to-File Plugin\u003c/h1\u003e\n  \u003cp\u003eSave DOM styles to CSS file\u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003eInstall\u003c/h2\u003e\n\n```bash\nnpm i -D posthtml-style-to-file\n```\n\n\u003ch2 align=\"center\"\u003eUsage\u003c/h2\u003e\n\n## Options\n\n#### `path`\n\nType: `String`  \nDefault: `./result.css`  \nDescription: *Destination path, where the extracted CSS is saved to.*  \n\n#### `removeStyle`\n\nType: `String`  \nDefault: ``  \nDescription: *Removes the specified value `attrs` | `tag` | `all`*  \n\n__`removeStyle`__\n\nDestination path, where the extracted CSS is saved to.\n\n\u003ch2 align=\"center\"\u003eExample\u003c/h2\u003e\n\n```js\nconst posthtml = require('posthtml')\nconst styleToFile = require('posthtml-style-to-file')\n\nconst html = readFileSync('path/to/html', 'utf8')\n\nposthtml([ styleToFile({ path: './dist/style.css' }) ])\n    .process(html)\n    .then((result) =\u003e console.log(result.html))\n```\n\n__index.html__\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003eWow\u003c/title\u003e\n    \u003cstyle type=\"text/css\"\u003e\n        html { margin: 0 }\n    \u003c/style\u003e\n\u003c/head\u003e\n\u003cbody style=\"background: #fff;\"\u003e\n  \u003cdiv class=\"button\" style=\"border: 1px solid #000;\"\u003e\n    \u003cdiv class=\"button__text\"\u003e\n        Text\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n__style.css__\n\n```css\nhtml{ margin: 0 }\nbody{ background: #fff; }\ndiv.button{ border: 1px solid #000; }\n```\n\n[npm]: https://img.shields.io/npm/v/posthtml-style-to-file.svg\n[npm-url]: https://npmjs.com/package/posthtml-style-to-file\n\n[deps]: https://david-dm.org/posthtml/posthtml-style-to-file.svg\n[deps-url]: https://david-dm.org/posthtml/posthtml-style-to-file\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[travis]: http://img.shields.io/travis/posthtml/posthtml-style-to-file.svg\n[travis-url]: https://travis-ci.org/posthtml/posthtml-style-to-file\n\n[cover]: https://coveralls.io/repos/github/posthtml/posthtml-style-to-file/badge.svg\n[cover-url]: https://coveralls.io/github/posthtml/posthtml-style-to-file\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-style-to-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-style-to-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-style-to-file/lists"}