{"id":40506198,"url":"https://github.com/tomhodgins/jsincss-xpath-selector","last_synced_at":"2026-01-20T19:36:17.224Z","repository":{"id":57284480,"uuid":"119000448","full_name":"tomhodgins/jsincss-xpath-selector","owner":"tomhodgins","description":"A jsincss plugin that lets you select elements to style using XPath selectors","archived":false,"fork":false,"pushed_at":"2018-12-24T20:57:32.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-10T23:57:01.684Z","etag":null,"topics":["css","css-selector","js-in-css","jsincss","selector-resolver","xpath","xpath-selector"],"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/tomhodgins.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-01-26T03:23:26.000Z","updated_at":"2018-12-24T20:57:34.000Z","dependencies_parsed_at":"2022-09-16T22:40:33.730Z","dependency_job_id":null,"html_url":"https://github.com/tomhodgins/jsincss-xpath-selector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tomhodgins/jsincss-xpath-selector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-xpath-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-xpath-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-xpath-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-xpath-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomhodgins","download_url":"https://codeload.github.com/tomhodgins/jsincss-xpath-selector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomhodgins%2Fjsincss-xpath-selector/sbom","scorecard":{"id":892629,"data":{"date":"2025-08-18","repo":{"name":"github.com/tomhodgins/jsincss-xpath-selector","commit":"ded54e6a4088ab733f1ecda637b137de7e93458f"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T12:26:53.106Z","repository_id":57284480,"created_at":"2025-08-24T12:26:53.106Z","updated_at":"2025-08-24T12:26:53.106Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28610770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["css","css-selector","js-in-css","jsincss","selector-resolver","xpath","xpath-selector"],"created_at":"2026-01-20T19:36:16.355Z","updated_at":"2026-01-20T19:36:17.215Z","avatar_url":"https://github.com/tomhodgins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsincss-xpath-selector\n\nAn XPath selector plugin for [jsincss](https://github.com/tomhodgins/jsincss) that lets you select elements to style using XPath selectors.\n\n## About\n\nThis plugin is a JavaScript module that works with [JS-in-CSS stylesheets](https://responsive.style/theory/what-is-a-jic-stylesheet.html), to apply styles to an element in an HTML document based on an XPath selector.\n\n## Downloading\n\nYou can download jsincss-xpath-selector and add it to your codebase manually, or download it with npm:\n\n```bash\nnpm install jsincss-xpath-selector\n```\n\nAnother option that works for building or testing, that isn't ideal for production use, is linking to the module directly from a CDN like unpkg:\n\n```html\n\u003cscript type=module\u003e\n  import xpath from 'https://unpkg.com/jsincss-xpath-selector/index.vanilla.js'\n\u003c/script\u003e\n```\n\n## Importing\n\nThis plugin exists in three different formats:\n\n- CommonJS module: [index.js](index.js)\n- Vanilla JS module: [index.vanilla.js](index.vanilla.js)\n- Browser function: [index.browser.js](index.browser.js)\n\nYou can import this plugin using the native [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) statement in JavaScript. Here you can assign any name you want to the function you are importing, and you only need to provide a path to the plugin's `index.vanilla.js` file:\n\n```js\nimport xpath from './index.vanilla.js'\n```\n\nYou can also use the CommonJS-formatted module located at [index.js](index.js) with `require()` for use with bundlers that don't use vanilla JS modules.\n\nOnce you have imported this plugin into your module, you can use the plugin as `xpath()`\n\n## Using JS-in-CSS Stylesheets\n\nThe main goal of this plugin is to allow CSS authors the ability to use XPath selectors to select elements and apply a CSS rule to them.\n\nThe plugin has the following format:\n\n```js\nxpath(selector, rule)\n```\n\n- `selector` is a string containing an XPath selector\n- `rule` is a string or template string containing a CSS rule\n\n## Example\n\nThis example will use the `jsincss` plugin to load a JS-in-CSS stylesheet making use of this plugin. To test it in a JavaScript module, import both the `jsincss` package and any helper plugins you want:\n\n```html\n\u003cscript type=module\u003e\n  import jsincss from 'https://unpkg.com/jsincss/index.vanilla.js'\n  import xpath from 'https://unpkg.com/jsincss-xpath-selector/index.vanilla.js'\n\n  jsincss(() =\u003e `\n\n    ${xpath('//*', `\n      border: 1px solid red;\n    `)}\n\n  `)\n\u003c/script\u003e\n```\n\nIt's also possible to write your stylesheets as a separate JavaScript module like this, where you import any helper plugins at the top of the stylesheet:\n\n```js\nimport xpath from 'https://unpkg.com/jsincss-xpath-selector/index.vanilla.js'\n\nexport default () =\u003e `\n\n  ${xpath('//*', `\n    border: 1px solid red;\n  `)}\n\n`\n```\n\nAnd then import both the `jsincss` plugin and the stylesheet into your code and run them like this, suppling any `selector` or `events` list the `jsincss` plugin might need to apply the stylesheet only the the element(s) and event(s) you require, depending on what you're doing:\n\n```js\nimport jsincss from 'https://unpkg.com/jsincss/index.vanilla.js'\nimport stylesheet from './path/to/stylesheet.js'\n\njsincss(stylesheet)\n```\n\n## Compatible JS-in-CSS Stylesheet Loaders\n\n- [jsincss](https://github.com/tomhodgins/jsincss)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhodgins%2Fjsincss-xpath-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomhodgins%2Fjsincss-xpath-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhodgins%2Fjsincss-xpath-selector/lists"}