{"id":19652983,"url":"https://github.com/csstools/postcss-resolve-nested-selector","last_synced_at":"2025-04-05T05:04:36.289Z","repository":{"id":48253776,"uuid":"52059936","full_name":"csstools/postcss-resolve-nested-selector","owner":"csstools","description":"Resolve a nested selector in a PostCSS AST","archived":false,"fork":false,"pushed_at":"2024-12-28T19:07:26.000Z","size":72,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-27T17:21:32.602Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-19T03:54:10.000Z","updated_at":"2025-02-17T05:22:16.000Z","dependencies_parsed_at":"2025-02-23T19:11:59.087Z","dependency_job_id":"d8d59c4b-74ed-4812-aa2c-715df736e9d4","html_url":"https://github.com/csstools/postcss-resolve-nested-selector","commit_stats":{"total_commits":19,"total_committers":4,"mean_commits":4.75,"dds":0.4736842105263158,"last_synced_commit":"1a0bbd9d7ebcb20f1e25b7a25a088bf64db813f0"},"previous_names":["csstools/postcss-resolve-nested-selector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-resolve-nested-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-resolve-nested-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-resolve-nested-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-resolve-nested-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-resolve-nested-selector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289424,"owners_count":20914464,"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:12:49.993Z","updated_at":"2025-04-05T05:04:36.257Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-resolve-nested-selector\n\n[![test](https://github.com/csstools/postcss-resolve-nested-selector/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/csstools/postcss-resolve-nested-selector/actions/workflows/test.yml)\n\nGiven a (nested) selector in a PostCSS AST, return an array of resolved selectors.\n\nTested to work with the syntax of [postcss-nested](https://github.com/postcss/postcss-nested).\nShould also work with SCSS and Less syntax. If you'd like to help out by\nadding some automated tests for those, that'd be swell. In fact, if you'd\nlike to add any automated tests, you are a winner!\n\nIf you want to resolve selectors in the same style as [postcss-nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting) you should instead use [selector-resolve-nested](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-resolve-nested)\n\n## API\n\n`resolveNestedSelector(selector, node)`\n\nReturns an array of selectors resolved from `selector`.\n\nFor example, given this JS:\n\n```js\nvar resolvedNestedSelector = require('postcss-resolve-nested-selector');\npostcssRoot.eachRule(function(rule) {\n\trule.selectors.forEach(function(selector) {\n\t\tconsole.log(resolvedNestedSelector(selector, rule));\n\t});\n});\n```\n\nAnd the following CSS:\n\n```scss\n.foo {\n\t.bar {\n\t\tcolor: pink;\n\t}\n}\n```\n\nThis should log:\n\n```\n['.foo']\n['.foo .bar']\n```\n\nOr with this CSS:\n\n```scss\n.foo {\n\t.bar \u0026,\n\ta {\n\t\tcolor: pink;\n\t}\n}\n```\n\nThis should log:\n\n```\n['.foo']\n['.bar .foo']\n['.foo a']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-resolve-nested-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-resolve-nested-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-resolve-nested-selector/lists"}