{"id":20572508,"url":"https://github.com/nucliweb/jxl-in-css","last_synced_at":"2026-02-07T05:32:19.603Z","repository":{"id":52894337,"uuid":"357514025","full_name":"nucliweb/jxl-in-css","owner":"nucliweb","description":"PostCSS plugin to use JXL in CSS background","archived":false,"fork":false,"pushed_at":"2022-12-10T22:58:03.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T08:32:55.416Z","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/nucliweb.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":"2021-04-13T10:32:37.000Z","updated_at":"2023-03-20T12:09:15.000Z","dependencies_parsed_at":"2023-01-26T12:15:55.324Z","dependency_job_id":null,"html_url":"https://github.com/nucliweb/jxl-in-css","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nucliweb/jxl-in-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucliweb%2Fjxl-in-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucliweb%2Fjxl-in-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucliweb%2Fjxl-in-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucliweb%2Fjxl-in-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nucliweb","download_url":"https://codeload.github.com/nucliweb/jxl-in-css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nucliweb%2Fjxl-in-css/sbom","scorecard":{"id":698088,"data":{"date":"2025-08-11","repo":{"name":"github.com/nucliweb/jxl-in-css","commit":"f0235d2f8b7b659362d96553d3a07de3656e3326"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"27 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T04:18:41.154Z","repository_id":52894337,"created_at":"2025-08-22T04:18:41.154Z","updated_at":"2025-08-22T04:18:41.154Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29187204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T05:07:31.176Z","status":"ssl_error","status_checked_at":"2026-02-07T05:06:15.227Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-16T05:20:58.192Z","updated_at":"2026-02-07T05:32:19.586Z","avatar_url":"https://github.com/nucliweb.png","language":"JavaScript","readme":"# JPEG XL in CSS\n\n\u003cimg src=\"https://github.com/nucliweb/jxl-in-css/blob/main/assets/jpegxl.svg?raw=true\" align=\"right\"\n     alt=\"JPEG XL logo\" width=\"70\" height=\"80\"\u003e\n\n[PostCSS] plugin and tiny JS script *(150B)* to use[JPEG XL] in CSS background\n\nWith this PostCSS Plugin you can use **JPEG XL** image format in your CSS background in [Supported Browsers](#supported-browsers), and fallback with the original image.\n\n\n## How works?\n\nYou add `require('jxl-in-css')` to your JS bundle and write CSS like:\n\n```css\n.logo {\n  width: 80px;\n  height: 80px;\n  background-image: url(logo.jpg);\n}\n```\n\nThe script will set `jxl` or `no-jxl` class on `\u003cbody\u003e` and PostCSS plugin will generate:\n\n```css\n.logo {\n  width: 80px;\n  height: 80px;\n}\nbody.jxl .logo {\n  background-image: url(logo.jxl);\n}\nbody.no-jxl .logo {\n  background-image: url(logo.jpg);\n}\n```\n\n## Usage\n\n### 1. Convert to JXL\n\nConvert you images to jxl format, you can use [Squoosh], [JPEGXL.io], or take a look to the software list on [JPEGXL.info]\n\n### 2. Install `jxl-in-css`\n\n```sh\nnpm install --save-dev jxl-in-css\n```\n#### 2.1 Load the polyfill\n\nAdd the JS script to your client-side JS bundle:\n\n```diff js\n// CommonJS\n+ require('jxl-in-css/polyfill.js')\n\n// ES6\n+ import 'jxl-in-css/polyfill.js'\n```\n\nSince JS script is very small (315B gzipped), the best way for landings\nis to inline it to HTML:\n\n```diff html\n+   \u003cscript\u003e\u003c%= readFile('node_modules/jxl-in-css') %\u003e\u003c/script\u003e\n  \u003c/head\u003e\n```\n\nYou can load the script via CDN:\n\n```diff html\n+   \u003cscript src=\"https://unpkg.com/jxl-in-css/polyfill.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n```\n\n#### 2.2 Load the PostCSS plugin\n\nCheck do you use PostCSS already in your bundler. You can check `postcss.config.js` in the project root, `\"postcss\"` section in `package.json` or `postcss` in bundle config.\n\nIf you don’t have it already, add PostCSS to your bundle:\n\n* For webpack see [postcss-loader] docs.\n* For Parcel create `postcss.config.js` file.\n  It already has PostCSS support.\n#### Add `jxl-in-css` to PostCSS plugins\n\n```diff js\nmodule.exports = {\n  plugins: [\n+   require('jxl-in-css'),\n    require('autoprefixer')\n  ]\n}\n```\nIf you use CSS Modules in webpack add `modules: true` option:\n\n```diff js\nmodule.exports = {\n  plugins: [\n-   require(jxl-in-css'),\n+   require(jxl-in-css')({ modules: true }),\n    require('autoprefixer')\n  ]\n}\n```\n\n## PostCSS Options\n\n```js\nmodule.exports = {\n  plugins: [\n    require('jxl-in-css')({ /* options */ }),\n  ]\n}\n```\n| Option | Description | Default Value | Type Value |\n| ------ | ----------- | ------------- | ---------- |\n| `modules` |  Wrap classes to `:global()` to support CSS Modules. | `false` | Boolean |\n| `jxlClass` |  Class name for browser with jxl support. | `jxl` | String |\n| `noJxlClass` |  Class name for browser without jxl support. | `no-jxl` | String |\n| `rename` |  Get a new file name from old name, like `(oldName: string) =\u003e string`, then `url(./image.png)` → `url(./image.png.jxl)`. | | Function |\n\n## Supported browsers\n\n* Chrome 92+ with **Enabled JXL image format** `chrome://flags/#enable-jxl`\n* Firefox 90+ with the image.jxl.enabled flag in about:config in Nightly only.\n* Edge 91+ with the --enable-features=JXL runtime flag. \n\n[PostCSS]: https://github.com/postcss/postcss\n[JPEG XL]: https://jpeg.org/jpegxl/\n[Squoosh]: https://squoosh.app/\n[postcss-loader]: https://github.com/postcss/\n[JPEGXL.io]: https://jpegxl.io/\n[JPEGXL.info]: https://jpegxl.info/","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucliweb%2Fjxl-in-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnucliweb%2Fjxl-in-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnucliweb%2Fjxl-in-css/lists"}