{"id":24989966,"url":"https://github.com/yacodes/posthtml-collect-styles","last_synced_at":"2025-03-29T12:15:42.240Z","repository":{"id":57328799,"uuid":"59577930","full_name":"yacodes/posthtml-collect-styles","owner":"yacodes","description":"Move all styles tags' content to the head element","archived":false,"fork":false,"pushed_at":"2016-05-24T14:12:10.000Z","size":4,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T00:37:12.490Z","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/yacodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-24T13:58:11.000Z","updated_at":"2023-03-05T00:12:22.000Z","dependencies_parsed_at":"2022-09-07T16:30:30.358Z","dependency_job_id":null,"html_url":"https://github.com/yacodes/posthtml-collect-styles","commit_stats":null,"previous_names":["canvaskisa/posthtml-collect-styles"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yacodes%2Fposthtml-collect-styles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yacodes%2Fposthtml-collect-styles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yacodes%2Fposthtml-collect-styles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yacodes%2Fposthtml-collect-styles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yacodes","download_url":"https://codeload.github.com/yacodes/posthtml-collect-styles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246180922,"owners_count":20736460,"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-04T13:04:09.423Z","updated_at":"2025-03-29T12:15:42.218Z","avatar_url":"https://github.com/yacodes.png","language":"JavaScript","readme":"# Posthtml-collect-styles \u003cimg align=\"right\" width=\"220\" height=\"200\" title=\"PostHTML logo\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n\n[![NPM version](http://img.shields.io/npm/v/posthtml-collect-styles.svg)](https://www.npmjs.org/package/posthtml-collect-styles)\n[![Travis Build Status](https://travis-ci.org/canvaskisa/posthtml-collect-styles.svg)](https://travis-ci.org/canvaskisa/posthtml-collect-styles)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n## Installation\n```console\n$ npm i --save posthtml-collect-styles\n```\n\n## Usage\n```html\n\u003c!-- index.html --\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cstyle\u003e.red {color: red;}\u003c/style\u003e\n  \u003cstyle\u003e.white {color: white;}\u003c/style\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n```js\n/* index.js */\nvar fs = require('fs');\nvar posthtml = require('posthtml');\n\nposthtml()\n  .use(require('posthtml-collect-styles')('style'))\n  .process(fs.readFileSync('index.html', 'utf8'))\n  .then(function(result) {\n    return result; \n\n    /**\n     * \u003chtml\u003e\n     *  \u003chead\u003e\n     *    \u003cstyle\u003e\n     *      .red {color: red;}\n     *      .white {color: white;}\n     *    \u003c/style\u003e\n     *  \u003c/head\u003e\n     *  \u003cbody\u003e\u003c/body\u003e\n     * \u003c/html\u003e\n     */\n  });\n```\n## Api\n`selector: string`: Selector to append styles, passed to [posthtml-match-helper](https://github.com/rasmusfl0e/posthtml-match-helper). `default: 'head'`.\n\n## License\nMIT © [Aleksandr Yakunichev](https://github.com/canvaskisa)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyacodes%2Fposthtml-collect-styles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyacodes%2Fposthtml-collect-styles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyacodes%2Fposthtml-collect-styles/lists"}