From 4e624ec64275003c17a17d5f5ff84562dedb3e0c Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 30 Apr 2026 00:16:27 +0800 Subject: [PATCH] feat: use real logos for QUDT, UCUM, and BIPM authority badges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace text-based authority icons (ⓢ, ⓤ, ⓠ) with actual SVG logos in UnitsDB entity detail external references section. - Add logo-qudt.svg, logo-ucum.svg, logo-bipm.svg to public assets - Update UnitsDBEntityDetail to render logos via in auth badges - Adjust badge CSS for variable-width logos (BIPM/QUDT are wide, UCUM is circular) with per-authority sizing --- .../theme/components/UnitsDBEntityDetail.vue | 29 ++++++++++++------- public/logo-bipm.svg | 1 + public/logo-qudt.svg | 1 + public/logo-ucum.svg | 1 + 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 public/logo-bipm.svg create mode 100644 public/logo-qudt.svg create mode 100644 public/logo-ucum.svg diff --git a/.vitepress/theme/components/UnitsDBEntityDetail.vue b/.vitepress/theme/components/UnitsDBEntityDetail.vue index f91f14b..b2492b2 100644 --- a/.vitepress/theme/components/UnitsDBEntityDetail.vue +++ b/.vitepress/theme/components/UnitsDBEntityDetail.vue @@ -34,11 +34,10 @@ const AUTHORITY_LABEL: Record = { nist: 'NIST', } -const AUTHORITY_ICON: Record = { - 'si-digital-framework': 'ⓢ', - ucum: 'ⓤ', - qudt: 'ⓠ', - nist: 'Ⓝ', +const AUTHORITY_LOGO: Record = { + 'si-digital-framework': '/logo-bipm.svg', + ucum: '/logo-ucum.svg', + qudt: '/logo-qudt.svg', } const DISPLAY_SYMBOLS = ['unicode'] @@ -521,7 +520,10 @@ async function copyLink() { :href="ref.uri.startsWith('http') ? ref.uri : undefined" target="_blank" rel="noopener" class="ep-ref-row ep-extref"> - {{ AUTHORITY_ICON[ref.authority] || '◆' }} + + + + {{ AUTHORITY_LABEL[ref.authority] || ref.authority }} {{ ref.uri }} @@ -763,14 +765,21 @@ async function copyLink() { } .ep-auth-badge { display: inline-flex; align-items: center; justify-content: center; - width: 22px; height: 22px; border-radius: 5px; + width: auto; min-width: 22px; height: 22px; border-radius: 5px; + padding: 0 6px; font-size: 0.5625rem; font-weight: 700; flex-shrink: 0; background: var(--vp-c-bg-soft); border: 1px solid var(--vp-c-divider); color: var(--vp-c-text-2); } -.ep-auth-si-digital-framework { background: rgba(20,184,166,0.1); border-color: rgba(20,184,166,0.3); color: #14b8a6; } -.ep-auth-ucum { background: rgba(87,160,254,0.1); border-color: rgba(87,160,254,0.3); color: #57a0fe; } -.ep-auth-qudt { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.3); color: #8b5cf6; } +.ep-auth-logo { + height: 14px; width: auto; max-width: 60px; object-fit: contain; +} +.ep-auth-si-digital-framework { background: rgba(20,184,166,0.1); border-color: rgba(20,184,166,0.3); padding: 0 4px; } +.ep-auth-si-digital-framework .ep-auth-logo { height: 16px; max-width: 52px; } +.ep-auth-ucum { background: rgba(87,160,254,0.1); border-color: rgba(87,160,254,0.3); padding: 2px; } +.ep-auth-ucum .ep-auth-logo { height: 16px; max-width: 16px; } +.ep-auth-qudt { background: rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.3); padding: 0 4px; } +.ep-auth-qudt .ep-auth-logo { height: 14px; max-width: 44px; } .ep-auth-nist { background: rgba(45,44,105,0.1); border-color: rgba(45,44,105,0.3); color: #2d2c69; } .ep-auth-label { font-size: 0.75rem; font-weight: 500; color: var(--vp-c-text-1); } diff --git a/public/logo-bipm.svg b/public/logo-bipm.svg new file mode 100644 index 0000000..ecf385b --- /dev/null +++ b/public/logo-bipm.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/logo-qudt.svg b/public/logo-qudt.svg new file mode 100644 index 0000000..a4d869a --- /dev/null +++ b/public/logo-qudt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/logo-ucum.svg b/public/logo-ucum.svg new file mode 100644 index 0000000..ff9e6eb --- /dev/null +++ b/public/logo-ucum.svg @@ -0,0 +1 @@ + \ No newline at end of file