{"id":24983681,"url":"https://github.com/posthtml/posthtml-inline-css","last_synced_at":"2025-04-11T20:51:36.449Z","repository":{"id":57328818,"uuid":"46575205","full_name":"posthtml/posthtml-inline-css","owner":"posthtml","description":"CSS Inliner","archived":false,"fork":false,"pushed_at":"2020-10-25T18:16:54.000Z","size":26,"stargazers_count":22,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T21:06:06.072Z","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.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-20T16:59:43.000Z","updated_at":"2023-05-13T01:57:44.000Z","dependencies_parsed_at":"2022-09-05T12:50:46.887Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-inline-css","commit_stats":null,"previous_names":["maltsev/posthtml-inline-css"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-inline-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-inline-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-inline-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-inline-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-inline-css/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:20:16.525Z","updated_at":"2025-04-11T20:51:36.411Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"# posthtml-inline-css [![npm version](https://badge.fury.io/js/posthtml-inline-css.svg)](http://badge.fury.io/js/posthtml-inline-css) [![Build Status](https://travis-ci.org/posthtml/posthtml-inline-css.svg?branch=master)](https://travis-ci.org/posthtml/posthtml-inline-css)\n\n[PostHTML](https://github.com/posthtml/posthtml) plugin for inlining CSS to style attrs.\n\nMany modern email clients nowadays support CSS in a `\u003cstyle\u003e`, so you might not need to inline CSS.\nSee [that discussion](https://github.com/posthtml/posthtml-inline-css/issues/14).\n\n## Usage\n### Plain CSS\n```js\nvar posthtml = require('posthtml'),\n    css = 'div { color: red }';\n\nposthtml([require('posthtml-inline-css')(css)])\n    .process('\u003cdiv style=\"font-size: 14px\"\u003eHello!\u003c/div\u003e')\n    .then(function (result) {\n        console.log(result.html);\n    });\n\n// \u003cdiv style=\"font-size: 14px; color: red\"\u003eHello!\u003c/div\u003e\n```\n\n\n### \u0026lt;style\u0026gt;\n```js\nvar posthtml = require('posthtml'),\n    html = '\u003cstyle\u003ediv { color: red }\u003c/style\u003e\u003cdiv\u003eHello!\u003c/div\u003e';\n\nposthtml([require('posthtml-inline-css')()])\n    .process(html)\n    .then(function (result) {\n        console.log(result.html);\n    });\n\n// \u003cstyle\u003ediv { color: red }\u003c/style\u003e\u003cdiv style=\"color: red\"\u003eHello!\u003c/div\u003e\n```\n\n\n### PostCSS\n```js\nvar posthtml = require('posthtml'),\n    postcss = require('postcss'),\n    postcssObj = postcss(/* some PostCSS plugins */).process('div { color: white }');\n\n\nposthtml([require('posthtml-inline-css')(postcssObj)])\n    .process('\u003cdiv style=\"font-size: 14px\"\u003eHello!\u003c/div\u003e')\n    .then(function (result) {\n        console.log(result.html);\n    });\n\n// \u003cdiv style=\"font-size: 14px; color: white\"\u003eHello!\u003c/div\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-inline-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-inline-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-inline-css/lists"}