{"id":22168786,"url":"https://github.com/chrisboakes/postcss-encode-background-svgs","last_synced_at":"2025-07-26T12:32:20.613Z","repository":{"id":26346160,"uuid":"108150987","full_name":"chrisboakes/postcss-encode-background-svgs","owner":"chrisboakes","description":"PostCSS plugin to encode background svgs","archived":false,"fork":false,"pushed_at":"2023-01-07T06:49:59.000Z","size":1234,"stargazers_count":9,"open_issues_count":18,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T00:09:50.915Z","etag":null,"topics":["postcss","postcss-plugin","postcss-plugins"],"latest_commit_sha":null,"homepage":null,"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/chrisboakes.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":null,"security":null,"support":null}},"created_at":"2017-10-24T16:02:16.000Z","updated_at":"2021-08-12T14:08:32.000Z","dependencies_parsed_at":"2022-09-18T17:50:26.069Z","dependency_job_id":null,"html_url":"https://github.com/chrisboakes/postcss-encode-background-svgs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/chrisboakes/postcss-encode-background-svgs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisboakes%2Fpostcss-encode-background-svgs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisboakes%2Fpostcss-encode-background-svgs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisboakes%2Fpostcss-encode-background-svgs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisboakes%2Fpostcss-encode-background-svgs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisboakes","download_url":"https://codeload.github.com/chrisboakes/postcss-encode-background-svgs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisboakes%2Fpostcss-encode-background-svgs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266296802,"owners_count":23907012,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["postcss","postcss-plugin","postcss-plugins"],"created_at":"2024-12-02T06:26:51.587Z","updated_at":"2025-07-26T12:32:20.229Z","avatar_url":"https://github.com/chrisboakes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Encode Background SVGs\n[![Build Status][travis-badge]][travis-link] [![Code Coverage][codecov-badge]][codecov-link] [![StyleCI][styleci-badge]][styleci-link] [![npm version][npm-badge-version]][npm-link]\n\n[npm-badge-version]: https://img.shields.io/npm/v/postcss-encode-background-svgs.svg\n[npm-link]: https://www.npmjs.com/package/postcss-encode-background-svgs\n[travis-badge]: https://travis-ci.org/chrisboakes/postcss-encode-background-svgs.svg?branch=master\n[travis-link]: https://travis-ci.org/chrisboakes/postcss-encode-background-svgs\n[codecov-badge]: https://codecov.io/gh/chrisboakes/postcss-encode-background-svgs/branch/master/graph/badge.svg\n[codecov-link]: https://codecov.io/gh/chrisboakes/postcss-encode-background-svgs\n[styleci-badge]: https://styleci.io/repos/108150987/shield?branch=master\n[styleci-link]: https://styleci.io/repos/108150987\n\n[PostCSS](https://github.com/postcss/postcss) plugin to encode background-image SVGs for cross browser compatibility.\n\n### The Problem\nBackground image SVGs are great but they don't render on IE unless encoded properly.\n\n### The Solution\nWrite your background as you usually would:\n\n```scss\n/* Input example */\nbackground-image: url('data:image/svg+xml, \u003csvg xmlns=\"http://www.w3.org/2000/svg\"\u003e\u003c/svg\u003e');\n```\nThis encoder will then take your readable SVG and return a UTF-8 cross browser encoded solution like so:\n\n```scss\n/* Output example */\nbackground-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E\");\n```\n\n## Installation\n[yarn](https://yarnpkg.com/en/)\n\n```sh\nyarn add postcss-encode-background-svgs\n```\n\n[npm](https://www.npmjs.com/)\n\n```sh\nnpm install postcss-encode-background-svgs\n```\n\n## Usage\n```js\npostcss([require('postcss-encode-background-svgs')()])\n```\n\nSee the [PostCSS](https://github.com/postcss/postcss#usage) docs for examples for your environment.\n\nOnce included in your environment, the plugin will search for any scss value with ```data:image/svg+xml```.\n\n## Credits\n\nBig thanks for [Vasi](https://github.com/Vasiharan) and [Rob](https://github.com/RobDWaller) for their help with the Regex.\n\nMIT © [Chris Boakes](https://twitter.com/cboakes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisboakes%2Fpostcss-encode-background-svgs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisboakes%2Fpostcss-encode-background-svgs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisboakes%2Fpostcss-encode-background-svgs/lists"}