{"id":13448528,"url":"https://github.com/E-goi/css-inliner","last_synced_at":"2025-03-22T09:31:26.004Z","repository":{"id":52111926,"uuid":"165026815","full_name":"E-goi/css-inliner","owner":"E-goi","description":"Inline your css 100% in the browser and with no dependencies","archived":false,"fork":false,"pushed_at":"2021-05-07T10:28:18.000Z","size":154,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T14:27:47.149Z","etag":null,"topics":["css","css-inliner","email","html","inline-css","no-dependencies","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/E-goi.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":"2019-01-10T09:04:36.000Z","updated_at":"2023-08-24T03:05:56.000Z","dependencies_parsed_at":"2022-08-20T21:20:41.248Z","dependency_job_id":null,"html_url":"https://github.com/E-goi/css-inliner","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E-goi%2Fcss-inliner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E-goi%2Fcss-inliner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E-goi%2Fcss-inliner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/E-goi%2Fcss-inliner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/E-goi","download_url":"https://codeload.github.com/E-goi/css-inliner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244937751,"owners_count":20535124,"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","css-inliner","email","html","inline-css","no-dependencies","typescript"],"created_at":"2024-07-31T05:01:48.085Z","updated_at":"2025-03-22T09:31:25.162Z","avatar_url":"https://github.com/E-goi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# css-inliner\nInline your css 100% in the browser and with no dependencies\n\n## Install\n\nTo install the package, you can use npm or yarn:\n\n```bash\n  yarn add @e-goi/css-inliner\n```\n\n## Usage\n\nImport the package on your code\n\n```typescript\nimport { cssInliner } from '@e-goi/css-inliner';\n```\n\nUse the main function ```cssInliner``` to inject the style on the elements.\n\n```javascript\ncssInliner(\n  document.querySelector('html').innerHTML,\n  {\n    properties: {\n      width: true,\n      border: true,\n      cellpadding: true,\n      cellspacing: true\n    }\n  }\n).then(formatted =\u003e {\n  console.log(formatted);\n});\n```\n\n## Configuration\n\nThe second parameter of ```cssInliner``` is a configuration object.\n\n### Basic configuration\n\n| Configuration | Type | Default | Description |\n| -----------   | ---  | ---     | --------    |\n| url           | string | empty | url to replace on relative path ```src``` and ```href``` |\n| preserveMediaQueries | boolean | true | define if preserver or not @media queries |\n| apply | ApplyTags | - | tags to get the styles |\n| properties | ApplyProperties | - | apply style to some attributes |\n| remove | RemoveTags | - | remove tags after set the css inline |\n\n### ApplyTags configuration\n\n| Configuration | Type | Default | Description |\n| -----------   | ---  | ---     | --------    |\n| style | boolean | true | apply style tags |\n| link | boolean | true | apply content from link tags |\n\n### ApplyProperties configuration\n\n| Configuration | Type | Default | Description |\n| -----------   | ---  | ---     | --------    | \n| width | boolean | false | apply width style to width property |\n| border | boolean | false | apply border style to table border property |\n| cellpadding | boolean | false | apply td padding style to table cellpadding property |\n| cellspacing | boolean | false | apply border-spacing style to table cellspacing property |\n\n### RemoveTags configuration\n\n| Configuration | Type | Default | Description |\n| -----------   | ---  | ---     | --------    |\n| style | boolean | true | remove style tags |\n| link | boolean | true | remove link tags |\n| script | boolean | true | remove script tags |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FE-goi%2Fcss-inliner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FE-goi%2Fcss-inliner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FE-goi%2Fcss-inliner/lists"}