{"id":22130770,"url":"https://github.com/anthinkingcoder/postcss-retina-hairlines","last_synced_at":"2026-05-04T06:35:12.860Z","repository":{"id":57328443,"uuid":"148268339","full_name":"anthinkingcoder/postcss-retina-hairlines","owner":"anthinkingcoder","description":"Solve the problem of 1px under retina screen","archived":false,"fork":false,"pushed_at":"2018-09-11T13:34:41.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T12:14:53.219Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anthinkingcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-11T06:04:15.000Z","updated_at":"2018-09-11T13:34:45.000Z","dependencies_parsed_at":"2022-09-21T01:50:46.749Z","dependency_job_id":null,"html_url":"https://github.com/anthinkingcoder/postcss-retina-hairlines","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthinkingcoder%2Fpostcss-retina-hairlines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthinkingcoder%2Fpostcss-retina-hairlines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthinkingcoder%2Fpostcss-retina-hairlines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthinkingcoder%2Fpostcss-retina-hairlines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthinkingcoder","download_url":"https://codeload.github.com/anthinkingcoder/postcss-retina-hairlines/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240927,"owners_count":20583102,"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":"2024-12-01T18:19:32.730Z","updated_at":"2026-05-04T06:35:12.814Z","avatar_url":"https://github.com/anthinkingcoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"```css\n/* before */\n.example {\n    border: 1px solid red;\n}\n\n/* after */\n\n.example {\n    border: 1px solid transparent;\n    border-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\\'http://www.w3.org/2000/svg\\' height=\\'2px\\'%3E%3Crect fill='red' width=\\'100%25\\' height=\\'50%25\\'%3E %3C/rect%3E %3C/svg%3E\")  0 0 2 0 stretch;\n}\n```\n\n## Options\n\n#### `base64`\n\nType: `Boolean`  \nDefault: `false`\n\nAllows you to define whether UTF-8 or base64 encoding will be used.\n\n```css\n/* before { base64: true } */\n\n\n.example {\n    border: 1px solid red;\n}\n\n/* after */\n\n.example {\n    border: 1px solid transparent;\n    border-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGhlaWdodD0nMnB4Jz48cmVjdCBmaWxsPSJyZWQiIHdpZHRoPScxMDAlJyBoZWlnaHQ9JzUwJSc+IDwvcmVjdD4gPC9zdmc+\")  0 0 2 0 stretch;\n}\n```\n\n#### blackList\n\n```css\n/* before { blackList:['.example1'],base64:true } */\n\n\n.example {\n    border: 1px solid red;\n}\n\n.example1 {\n    border-left: 1px solid red;\n}\n\n/* after */\n\n.example {\n    border: 1px solid transparent;\n    border-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGhlaWdodD0nMnB4Jz48cmVjdCBmaWxsPSJyZWQiIHdpZHRoPScxMDAlJyBoZWlnaHQ9JzUwJSc+IDwvcmVjdD4gPC9zdmc+\")  0 0 2 0 stretch;\n}\n\n.example1 {\n    border-left: 1px solid red;\n}\n\n```\n\n\n## Usage\n\n```bash\nnpm install postcss-retina-hairlines --save-dev\n```\n#### PostCSS\n\n```bash\nnpm install postcss --save-dev\n```\n\n```js\nconst postcss = require('postcss')\npostcss([\n\trequire('postcss-retina-hairlines')({ /* options */ })\n]).process(YOUR_CSS, /* options */);\n```\n\n#### Gulp\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\n```js\nvar gulp = require('gulp')\nvar postcss = require('gulp-postcss')\nvar retinaHairlines = require('postcss-retina-hairlines')\n\nvar options = {\n  base64: true,\n  blackList: ['.example1']\n}\n\ngulp.task('css', function () {\n  return gulp.src('test/source.css')\n      .pipe(postcss([retinaHairlines(options)]))\n      .pipe(gulp.dest('example'))\n})\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n\tpostcss: {\n\t\toptions: {\n\t\t\tuse: [\n\t\t\t\trequire('postcss-retina-hairlines')({ /* options */ })\n\t\t\t]\n\t\t},\n\t\tdist: {\n\t\t\tsrc: '*.css'\n\t\t}\n\t}\n});\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthinkingcoder%2Fpostcss-retina-hairlines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthinkingcoder%2Fpostcss-retina-hairlines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthinkingcoder%2Fpostcss-retina-hairlines/lists"}