{"id":16484553,"url":"https://github.com/winston0410/postcss-auto-text-indent","last_synced_at":"2026-04-15T19:37:34.445Z","repository":{"id":45061333,"uuid":"293424919","full_name":"winston0410/postcss-auto-text-indent","owner":"winston0410","description":"A PostCSS Sparrow plugin that helps you append `text-indent` to a selector when `letter-spacing` is found, in order to center words correctly.","archived":false,"fork":false,"pushed_at":"2022-01-11T20:12:21.000Z","size":279,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-21T11:50:53.499Z","etag":null,"topics":["css","postcss","postcss-sparrow","tailwindcss"],"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/winston0410.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":"2020-09-07T04:50:05.000Z","updated_at":"2020-09-28T06:30:08.000Z","dependencies_parsed_at":"2022-09-09T14:21:27.738Z","dependency_job_id":null,"html_url":"https://github.com/winston0410/postcss-auto-text-indent","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winston0410%2Fpostcss-auto-text-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winston0410%2Fpostcss-auto-text-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winston0410%2Fpostcss-auto-text-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winston0410%2Fpostcss-auto-text-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winston0410","download_url":"https://codeload.github.com/winston0410/postcss-auto-text-indent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241241232,"owners_count":19932708,"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","postcss","postcss-sparrow","tailwindcss"],"created_at":"2024-10-11T13:17:28.461Z","updated_at":"2025-10-27T11:10:41.210Z","avatar_url":"https://github.com/winston0410.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Sparrow Auto Text Indent\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/cbc6af7af340fa86e009/maintainability)](https://codeclimate.com/github/winston0410/postcss-auto-text-indent/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/cbc6af7af340fa86e009/test_coverage)](https://codeclimate.com/github/winston0410/postcss-auto-text-indent/test_coverage) [![Known Vulnerabilities](https://snyk.io/test/github/winston0410/postcss-auto-text-indent/badge.svg?targetFile=package.json)](https://snyk.io/test/github/winston0410/postcss-auto-text-indent?targetFile=package.json) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/3afb8a2ef9b944f4a8dc1152490b1cea)](https://www.codacy.com/manual/winston0410/postcss-auto-text-indent?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=winston0410/postcss-auto-text-indent\u0026amp;utm_campaign=Badge_Grade)\n\nA PostCSS Sparrow plugin that helps you append `text-indent` to a selector when `letter-spacing` is found, in order to center words correctly.\n\n```css\n/* Before transformations */\n.foo {\n  letter-spacing: 10px;\n}\n```\n\n```css\n/* After transformations */\n.foo {\n  letter-spacing: 10px;\n  text-indent: 10px;\n}\n```\n\n## Why do I need this plugin?\n\nLetter spacing is added to the **right** instead of **in between** characters, thus you will need to offset it with `text-indent` or `padding-left` in order to center it correctly with `text-align: center`.\n\nThis plugin helps you achieve this automatically, which is particularly useful if you use [Tailwind CSS](https://tailwindcss.com/), as you do not need to create a new utility class for `text-indent`.\n\n## Installation\n\nThis plugin require you to use [PostCSS Sparrow](https://www.npmjs.com/package/postcss-sparrow) for matching with selectors you want.\n\nDownload both `postcss-sparrow` and this plugin through NPM.\n\n```shell\n\nnpm i postcss-sparrow postcss-sparrow-auto-text-indent\n\n```\n\nThen import this plugin as the callback for [PostCSS Sparrow](https://www.npmjs.com/package/postcss-sparrow).\n\n```javascript\n//postcss.config.js\nmodule.exports = {\n  plugins: [\n    //Other plugins...\n\n    require('postcss-sparrow')({\n      transformations: [\n        {\n          selectors: ['*'],\n          inclusion: true,\n          callbacks: [\n            require('postcss-sparrow-auto-text-indent')\n          ]\n        }\n      ]\n    })\n  ]\n}\n```\n\n## Full Code example\n\n```css\n/* Before transformations */\n.foo {\n  letter-spacing: 10px;\n}\n```\n\n```javascript\n//postcss.config.js\nmodule.exports = {\n  plugins: [\n    //Other plugins...\n\n    require('postcss-sparrow')({\n      transformations: [\n        {\n          selectors: ['*'],\n          inclusion: true,\n          callbacks: [\n            require('postcss-sparrow-auto-text-indent')\n          ]\n        }\n      ]\n    })\n  ]\n}\n```\n\n```css\n/* After transformations */\n.foo {\n  letter-spacing: 10px;\n  text-indent: 10px;\n}\n```\n\n## Configuration\n\nNo configuration is needed for this plugin. To prevent this plugin from appending `text-indent` to a selector, you should config the `selectors` options of [PostCSS Sparrow](https://www.npmjs.com/package/postcss-sparrow).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinston0410%2Fpostcss-auto-text-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinston0410%2Fpostcss-auto-text-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinston0410%2Fpostcss-auto-text-indent/lists"}