Skip to content

Commit 892f55b

Browse files
committed
style(site): space out roman numerals so vinculum bars stay distinct
1 parent dc61c6c commit 892f55b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎site/app.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ const interpret = (raw) => {
3232
return { str, value, negative, isDecimal, magnitude: digits.length };
3333
};
3434

35-
const row = (label, text) => {
35+
const row = (label, text, cls) => {
3636
const dt = document.createElement('dt');
3737
dt.textContent = label;
3838
const dd = document.createElement('dd');
39+
if (cls) dd.classList.add(cls);
3940
if (text === false || text == null) {
4041
dd.textContent = '—';
4142
dd.className = 'na';
@@ -73,7 +74,7 @@ const render = (raw) => {
7374

7475
row('comma', isDecimal ? false : comma(value));
7576
row('ordinal', wholeInt && value !== 0 && value !== 0n ? ordinal(value) : false);
76-
row('roman', smallInt && value >= 1 && value <= 3999999999 ? roman(value) : false);
77+
row('roman', smallInt && value >= 1 && value <= 3999999999 ? roman(value) : false, 'roman');
7778
row('year', smallInt && value >= 1000 && value <= 9999 ? year(value) : false);
7879
row('currency', !negative && typeof value === 'number' && value < 1e15 ? currency(`$${parsed.str}`) : false);
7980
row('telephone', wholeInt && parsed.magnitude <= 15 ? telephone(parsed.str) : false);

‎site/style.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ h2 {
121121
.facts dt { color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
122122
.facts dd { margin: 0; overflow-wrap: anywhere; }
123123
.facts dd.na { color: var(--muted); }
124+
/* vinculum bars need room so adjacent overlines don't merge */
125+
.facts dd.roman { font-family: var(--mono); letter-spacing: 0.12em; }
124126

125127
table { width: 100%; border-collapse: collapse; }
126128
td { padding: 8px 8px; border-top: 1px solid var(--border); vertical-align: top; }

0 commit comments

Comments
 (0)