diff --git a/CHANGELOG.md b/CHANGELOG.md index c4246b1..dea2363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Security + +- **source-map-js 1.2.2** (CVE-2026-93749, GHSA-68fv-2mgg-jv7q, event-loop denial of service through indexed source-map section offsets): a development-only, transitive dependency (jsdom → css-tree), raised in the lockfile; the published packages never contained it. jsdom, the development DOM and the CLI's optional peer, goes to 30.1.3 at the same time. + ### Documentation +- **LJ Create's logo on its reference card**, as LJ Create offered in #17: the card shows a logo on a light plate (a `--color-logo-plate` token, white in both colour schemes, since logos are drawn for light backgrounds) when its entry in `site/references/references.json` has one; only a complete logo (a file under `images/references/`, an alt text, its intrinsic size) is published. The approval filter moved to `site/scripts/approved-references.mjs`. - **References: LJ Cloud, LJ Create's learning portal** (cloud.ljcreate.com), which renders its course menus and lesson content with the library, listed with the reporter's permission (issue #17). The references tests read the approved entries from the data file instead of a fixed list. ## [1.3.4] - 2026-10-12 diff --git a/package-lock.json b/package-lock.json index f2b9f8b..42ba687 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@xmldom/xmldom": "^0.9.12", "esbuild": "^0.28.2", "eslint": "^10.11.0", - "jsdom": "^30.1.1", + "jsdom": "^30.1.3", "linkedom": "^0.18.13", "prettier": "^3.9.9" }, @@ -45,16 +45,16 @@ } }, "node_modules/@asamuzakjp/css-color": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-7.0.1.tgz", - "integrity": "sha512-C9duntabagkBZ1LebM7FKmphR4Q1pBclLxVbZETQV0akkFjV0ooFxo8FlvAQyKj9F6l8rEnmidgcTlpyxFYizg==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-7.1.7.tgz", + "integrity": "sha512-Q7ioeear07HwixdIitIn9KS1LZi97CEDFCSjPNm9v+y8KNbsu9q4Lrd4zUQW4faED+E7qxvfeVnbNRW46wFKuw==", "devOptional": true, "license": "MIT", "dependencies": { - "@csstools/css-calc": "^3.4.0", - "@csstools/css-color-parser": "^4.2.3", - "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-tokenizer": "^4.0.1", + "@csstools/css-calc": "^3.4.3", + "@csstools/css-color-parser": "^4.2.6", + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2", "lru-cache": "^11.5.3" }, "engines": { @@ -62,9 +62,9 @@ } }, "node_modules/@asamuzakjp/dom-selector": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-9.2.1.tgz", - "integrity": "sha512-NT4s3yZLjovPpliRpTvdsdzyPjqRqiCZj9MxnarBihbaY5MbAG7DWAJcrLlhmC7xKTNCXsTELcqB8YsqpLnUFQ==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-10.0.4.tgz", + "integrity": "sha512-A6f1nKy99I6tyoK82U6kBHvQQZmdHmTmPzJYPY/0eaOW0r8/qPmEOwjGHs+hL/vCgOwQTupu4LT1XtXNUuDruA==", "devOptional": true, "license": "MIT", "dependencies": { @@ -115,9 +115,9 @@ } }, "node_modules/@csstools/color-helpers": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.1.tgz", - "integrity": "sha512-gLNsunvwf3mCi5u5o46/Z/JcJMnhbHSaZ69rkgPzNM3J4s8hWwpPUQB6/tt0EDFyCiWzxANlx+2LJwpYj4zS1w==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.2.tgz", + "integrity": "sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==", "devOptional": true, "funding": [ { @@ -135,9 +135,9 @@ } }, "node_modules/@csstools/css-calc": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.0.tgz", - "integrity": "sha512-XQKj5B7QiZcHiegCOCAzcAOJdhGgWOHbbu62h5e5mkHnn8lWcfiJhllkqWmxu5zWR9jucPHuo1iTB56P033hcg==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-3.4.3.tgz", + "integrity": "sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==", "devOptional": true, "funding": [ { @@ -154,14 +154,14 @@ "node": ">=20.19.0" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" } }, "node_modules/@csstools/css-color-parser": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.3.tgz", - "integrity": "sha512-y4LpL+lmpuyKDiEFq2PnZUVFdAjsoB/qQJod79yLNokXyW7jewi+/WJ69EfItj8A2unWtxXnGjw6LYXgXu5ZjA==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.2.6.tgz", + "integrity": "sha512-iiPQ3iRWwnJkeEn6RIu6SJPr7hYrLz6XZ9s/QZl+2/LI5KQVjpl2fdmDSZKuD4xP6GMmMPgHFFXg6k1Wkz0Trg==", "devOptional": true, "funding": [ { @@ -175,21 +175,21 @@ ], "license": "MIT", "dependencies": { - "@csstools/color-helpers": "^6.1.1", - "@csstools/css-calc": "^3.4.0" + "@csstools/color-helpers": "^6.1.2", + "@csstools/css-calc": "^3.4.3" }, "engines": { "node": ">=20.19.0" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^4.0.0", - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-parser-algorithms": "^4.0.2", + "@csstools/css-tokenizer": "^4.0.2" } }, "node_modules/@csstools/css-parser-algorithms": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.0.tgz", - "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-4.0.2.tgz", + "integrity": "sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==", "devOptional": true, "funding": [ { @@ -206,13 +206,13 @@ "node": ">=20.19.0" }, "peerDependencies": { - "@csstools/css-tokenizer": "^4.0.0" + "@csstools/css-tokenizer": "^4.0.2" } }, "node_modules/@csstools/css-syntax-patches-for-csstree": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.13.tgz", - "integrity": "sha512-i9ZylF5QNhmNfPA9l0vHAWK4kPrbIp6g9lKgaiIFsIBz2F/WNB7OLrzlNNcCOm+h42bkaSD2v1PG+IBPHhc3ZA==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.1.15.tgz", + "integrity": "sha512-J0u7HkVl2nzSlhsiTOp4AmwcUQ3D+mGEEKfBy/7To5/y7F2OHwyLrXfrhR0SMgr4p5Lo+eaMVSeai24zUcBIxA==", "devOptional": true, "funding": [ { @@ -235,9 +235,9 @@ } }, "node_modules/@csstools/css-tokenizer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.1.tgz", - "integrity": "sha512-bPlN9S9O1A0euCpEWE4qnvB5YDuyYVsUTrxSgmAM1Is0j4tICHoVyOVAXfWMP/kS9ZrjvyIXWV2PmomiAXXqOw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-4.0.2.tgz", + "integrity": "sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==", "devOptional": true, "funding": [ { @@ -825,9 +825,9 @@ } }, "node_modules/@exodus/bytes": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.15.1.tgz", - "integrity": "sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", "devOptional": true, "license": "MIT", "engines": { @@ -1156,17 +1156,17 @@ "license": "MIT" }, "node_modules/data-urls": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-7.0.0.tgz", - "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", "devOptional": true, "license": "MIT", "dependencies": { "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^16.0.0" + "whatwg-url": "^17.1.2" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/debug": { @@ -1778,31 +1778,31 @@ "license": "ISC" }, "node_modules/jsdom": { - "version": "30.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.1.tgz", - "integrity": "sha512-FahmoPK5vbPc+jxV1iErMHmAZypCZ942NHF4+qqaWAuvaKKTBZxawnmAtrbGWLU7MtlxfqIP0qw6aSI+aWGtLg==", + "version": "30.1.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-30.1.3.tgz", + "integrity": "sha512-hQMUPvRgN7KxsfIytDQji7bimuJeRQa6Qo5+iuiZQk5CafeRxLIA10/cG5YCBFNpD9RO3oqIiN4CO1Y44kxqXg==", "devOptional": true, "license": "MIT", "dependencies": { - "@asamuzakjp/css-color": "^7.0.0", - "@asamuzakjp/dom-selector": "^9.2.1", + "@asamuzakjp/css-color": "^7.1.3", + "@asamuzakjp/dom-selector": "^10.0.3", "@bramus/specificity": "^2.4.2", - "@csstools/css-syntax-patches-for-csstree": "^1.1.13", - "@exodus/bytes": "^1.15.1", + "@csstools/css-syntax-patches-for-csstree": "^1.1.15", + "@exodus/bytes": "^1.16.0", "css-tree": "^3.2.1", - "data-urls": "^7.0.0", + "data-urls": "^8.0.0", "decimal.js": "^10.6.0", "html-encoding-sniffer": "^7.0.0", "is-potential-custom-element-name": "^1.0.1", - "lru-cache": "^11.5.2", + "lru-cache": "^11.5.3", "parse5": "^8.0.1", "saxes": "^6.0.0", "tough-cookie": "^6.0.2", - "undici": "^8.10.2", + "undici": "^8.12.1", "w3c-xmlserializer": "^6.0.0", "webidl-conversions": "^8.0.1", "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^17.1.1", + "whatwg-url": "^17.2.0", "xml-name-validator": "^5.0.0" }, "engines": { @@ -1817,21 +1817,6 @@ } } }, - "node_modules/jsdom/node_modules/whatwg-url": { - "version": "17.1.2", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-17.1.2.tgz", - "integrity": "sha512-TEZA+Zqxin7Jjsm2cjRohCmen5awh+hT6Zi3VZdqZlNRk7zvOI/9WpBFg/DWlA56bWnzwm6DuB8NS0EsxQH9uQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@exodus/bytes": "^1.15.1", - "tr46": "^6.0.0", - "webidl-conversions": "^8.0.1" - }, - "engines": { - "node": "^22.14.0 || >=24.0.0" - } - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2190,9 +2175,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "devOptional": true, "license": "BSD-3-Clause", "engines": { @@ -2233,16 +2218,16 @@ } }, "node_modules/tr46": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", - "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-7.0.0.tgz", + "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", "devOptional": true, "license": "MIT", "dependencies": { "punycode": "^2.3.1" }, "engines": { - "node": ">=20" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/type-check": { @@ -2266,9 +2251,9 @@ "license": "ISC" }, "node_modules/undici": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.11.2.tgz", - "integrity": "sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==", + "version": "8.12.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.12.3.tgz", + "integrity": "sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==", "devOptional": true, "license": "MIT", "engines": { @@ -2319,18 +2304,18 @@ } }, "node_modules/whatwg-url": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-16.0.1.tgz", - "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==", + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-17.3.0.tgz", + "integrity": "sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==", "devOptional": true, "license": "MIT", "dependencies": { - "@exodus/bytes": "^1.11.0", - "tr46": "^6.0.0", + "@exodus/bytes": "^1.16.0", + "tr46": "^7.0.0", "webidl-conversions": "^8.0.1" }, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + "node": "^22.14.0 || >=24.0.0" } }, "node_modules/which": { diff --git a/package.json b/package.json index 7d66b77..b180269 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@xmldom/xmldom": "^0.9.12", "esbuild": "^0.28.2", "eslint": "^10.11.0", - "jsdom": "^30.1.1", + "jsdom": "^30.1.3", "linkedom": "^0.18.13", "prettier": "^3.9.9" }, diff --git a/site/references/references.json b/site/references/references.json index 56a12d9..3f27a85 100644 --- a/site/references/references.json +++ b/site/references/references.json @@ -16,7 +16,13 @@ "name": "LJ Cloud — Learning Portal (LJ Create)", "url": "https://cloud.ljcreate.com", "use": "Renders its course menus and lesson content with XSLT through @tradik/xslt-processor, which also keeps LJ ClassAct II working.", - "approved": true + "approved": true, + "logo": { + "src": "images/references/ljcreate.png", + "alt": "LJ Create, Learning for life", + "width": 225, + "height": 88 + } } ], "builtOn": [ diff --git a/site/scripts/approved-references.mjs b/site/scripts/approved-references.mjs new file mode 100644 index 0000000..0873858 --- /dev/null +++ b/site/scripts/approved-references.mjs @@ -0,0 +1,48 @@ +/** + * Which references reach the website: entries of + * site/references/references.json with `approved: true` (the project agreed + * to be named), and their logo only when it is complete and a file of the + * site (images/references/). + * + * @module site/scripts/approved-references + */ + +/* global URL */ + +/** + * The usedBy entries that may be published: those with `approved: true`. + * + * @param {Array<{name: string, url: string, use: string, approved?: boolean}>} entries + * @returns {Array<{name: string, url: string, domain: string, use: string}>} + * Approved entries with the host name to show as the link text + */ +export function approvedReferences(entries) { + return entries + .filter((entry) => entry.approved === true) + .map(({ name, url, use, logo }) => ({ + name, + url, + domain: new URL(url).hostname.replace(/^www\./, ""), + use, + ...(validLogo(logo) ? { logo } : {}), + })); +} + +/** + * Whether an entry's logo can be shown: a path under the site, an alt text + * and the intrinsic size (so the card does not shift while it loads). Add a + * logo only when its owner allowed it, as for the entry itself. + * + * @param {*} logo - The entry's `logo` field + * @returns {boolean} True for a complete logo + */ +function validLogo(logo) { + return ( + typeof logo?.src === "string" && + /^images\/references\/[\w.-]+\.(png|svg|webp)$/.test(logo.src) && + typeof logo.alt === "string" && + logo.alt.length > 0 && + Number.isInteger(logo.width) && + Number.isInteger(logo.height) + ); +} diff --git a/site/scripts/references.mjs b/site/scripts/references.mjs index bcae25f..586166b 100644 --- a/site/scripts/references.mjs +++ b/site/scripts/references.mjs @@ -13,7 +13,11 @@ * @module site/scripts/references */ -/* global fetch, AbortSignal, URL -- Node.js 18+ globals */ +import { approvedReferences } from "./approved-references.mjs"; + +export { approvedReferences }; + +/* global fetch, AbortSignal -- Node.js 18+ globals */ /** npm downloads of the last month (30 days). */ export const NPM_DOWNLOADS_URL = @@ -29,24 +33,6 @@ export const FETCH_TIMEOUT_MS = 5000; /** Entries of the home page band. */ export const HOME_LIMIT = 6; -/** - * The usedBy entries that may be published: those with `approved: true`. - * - * @param {Array<{name: string, url: string, use: string, approved?: boolean}>} entries - * @returns {Array<{name: string, url: string, domain: string, use: string}>} - * Approved entries with the host name to show as the link text - */ -export function approvedReferences(entries) { - return entries - .filter((entry) => entry.approved === true) - .map(({ name, url, use }) => ({ - name, - url, - domain: new URL(url).hostname.replace(/^www\./, ""), - use, - })); -} - /** * A date as the page writes it, e.g. "3 October 2026". * diff --git a/site/scripts/references.test.mjs b/site/scripts/references.test.mjs index 2cebb08..fd7c17c 100644 --- a/site/scripts/references.test.mjs +++ b/site/scripts/references.test.mjs @@ -34,6 +34,35 @@ const apis = { }; describe("approved references", () => { + it("keeps a complete logo and drops an incomplete or foreign one", () => { + const logo = { + src: "images/references/a.png", + alt: "A", + width: 10, + height: 4, + }; + const entry = (extra) => ({ + name: "A", + url: "https://a.test", + use: "a", + approved: true, + ...extra, + }); + assert.deepEqual(approvedReferences([entry({ logo })])[0].logo, logo); + for (const bad of [ + { ...logo, src: "https://evil.test/x.png" }, + { ...logo, src: "images/references/../x.png" }, + { ...logo, alt: "" }, + { ...logo, width: "10" }, + null, + ]) { + assert.equal( + approvedReferences([entry({ logo: bad })])[0].logo, + undefined, + ); + } + }); + it("publishes only entries with approved: true", () => { const entries = [ { name: "A", url: "https://www.a.test/x", use: "a", approved: true }, diff --git a/site/templates/xslt-site/css/references.css b/site/templates/xslt-site/css/references.css index 1e5142e..3e24432 100644 --- a/site/templates/xslt-site/css/references.css +++ b/site/templates/xslt-site/css/references.css @@ -1,7 +1,7 @@ /* * References: the "Used by" cards (home page band and /references/), the * numbers from npm and GitHub, and the list of specifications and test - * suites. Text cards without logos; every colour is a token of tokens.css, + * suites. Text cards, with a logo on a light plate where its owner allowed one; every colour is a token of tokens.css, * so the light and dark pairs keep the WCAG 2.2 AA ratios check-site.mjs * verifies. Grid items get min-width: 0 so long names and URLs wrap instead * of widening the page on phones. @@ -33,6 +33,20 @@ overflow-wrap: anywhere; } +.ref-card__logo { + /* The card is a flex column: without align-self the image is stretched */ + align-self: flex-start; + display: block; + max-width: 100%; + height: auto; + max-height: 3.5rem; + width: auto; + margin-bottom: var(--space-3); + padding: var(--space-2); + border-radius: calc(var(--radius) / 2); + background: var(--color-logo-plate); +} + .ref-card h3 { margin: 0 0 var(--space-2); } diff --git a/site/templates/xslt-site/css/tokens.css b/site/templates/xslt-site/css/tokens.css index d71009e..4147363 100644 --- a/site/templates/xslt-site/css/tokens.css +++ b/site/templates/xslt-site/css/tokens.css @@ -22,6 +22,7 @@ /* contrast pairs checked by check-site.mjs: fg / bg */ --color-bg: #ffffff; /* style guide: Background */ --color-surface: #f8f9fa; /* Google Grey 50 */ + --color-logo-plate: #ffffff; /* behind third-party logos, both schemes */ --color-surface-strong: #f1f3f4; /* Google Grey 100 */ --color-hero: #e8f0fe; /* Google Blue 50 */ --color-text: #1f2937; /* style guide: Text */ @@ -53,6 +54,7 @@ :root { --color-bg: #202124; /* Google Grey 900 */ --color-surface: #292a2d; /* Google dark surface */ + --color-logo-plate: #ffffff; /* logos are made for light backgrounds */ --color-surface-strong: #35363a; /* Google dark surface, raised */ --color-hero: #292a2d; --color-text: #e8eaed; /* Google Grey 200 */ diff --git a/site/templates/xslt-site/images/references/ljcreate.png b/site/templates/xslt-site/images/references/ljcreate.png new file mode 100644 index 0000000..262148a Binary files /dev/null and b/site/templates/xslt-site/images/references/ljcreate.png differ diff --git a/site/templates/xslt-site/layouts/landing.html b/site/templates/xslt-site/layouts/landing.html index 5a98d3b..b991564 100644 --- a/site/templates/xslt-site/layouts/landing.html +++ b/site/templates/xslt-site/layouts/landing.html @@ -61,7 +61,7 @@
All references, with the specifications and test suites it is verified against
Using it too? Open an issue with a link and a sentence on what it does for you, and we will list it.
{{ .use }}