{"id":19653050,"url":"https://github.com/csstools/postcss-unnth","last_synced_at":"2025-04-28T17:31:21.140Z","repository":{"id":45538567,"uuid":"43685576","full_name":"csstools/postcss-unnth","owner":"csstools","description":"Replace :nth-child selectors with :first-child+ selectors","archived":true,"fork":false,"pushed_at":"2021-12-09T16:53:53.000Z","size":144,"stargazers_count":2,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-21T21:37:59.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T13:23:19.000Z","updated_at":"2024-10-23T21:22:46.000Z","dependencies_parsed_at":"2022-08-27T22:01:52.256Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-unnth","commit_stats":null,"previous_names":["jonathantneal/postcss-unnth"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unnth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unnth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unnth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-unnth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-unnth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219601,"owners_count":21554444,"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-11-11T15:13:01.608Z","updated_at":"2025-04-28T17:31:21.053Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnNth [![Build Status][ci-img]][ci]\n\n\u003cimg align=\"right\" width=\"135\" height=\"95\" src=\"http://postcss.github.io/postcss/logo-leftp.png\" title=\"Philosopher’s stone, logo of PostCSS\"\u003e\n\n[UnNth] replaces `:nth-child` selectors with `:first-child` selectors. This can be useful when outputting CSS for older browsers like Internet Explorer 8.\n\n```css\n/* before */\n\n.container \u003e p:nth-child(4).specific \u003e span {\n   font-weight: bold;\n}\n\n/* after */\n\n.container \u003e :first-child + * + * + p.specific \u003e span {\n    font-weight: bold;\n}\n```\n\n## Usage\n\nAdd [UnNth] to your build tool:\n\n```bash\nnpm install postcss-unnth --save-dev\n```\n\n#### Node\n\n```js\nrequire('postcss-unnth')({ /* options */ }).process(YOUR_CSS);\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nLoad [UnNth] as a PostCSS plugin:\n\n```js\npostcss([\n    require('postcss-unnth')({ /* options */ })\n]);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nEnable [UnNth] within your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n    return gulp.src('./css/src/*.css').pipe(\n        postcss([\n            require('postcss-unnth')({ /* options */ })\n        ])\n    ).pipe(\n        gulp.dest('./css')\n    );\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nEnable [UnNth] within your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n    postcss: {\n        options: {\n            processors: [\n                require('postcss-unnth')({ /* options */ })\n            ]\n        },\n        dist: {\n            src: 'css/*.css'\n        }\n    }\n});\n```\n\n[ci]: https://travis-ci.org/jonathantneal/postcss-unnth\n[ci-img]: https://travis-ci.org/jonathantneal/postcss-unnth.svg\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]: https://github.com/postcss/postcss\n[UnNth]: https://github.com/jonathantneal/postcss-unnth\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unnth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-unnth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-unnth/lists"}