Skip to content

Commit 66e0483

Browse files
committed
rustdoc: add comment about numeric spacing
1 parent 9fbee7d commit 66e0483

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustdoc/html/static/js/search.js

+4
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,10 @@ ${item.displayPath}<span class="${type}">${name}</span>\
23352335

23362336
function makeTabHeader(tabNb, text, nbElems) {
23372337
// https://blog.horizon-eda.org/misc/2020/02/19/ui.html
2338+
//
2339+
// CSS runs with `font-variant-numeric: tabular-nums` to ensure all
2340+
// digits are the same width. \u{2007} is a Unicode space character
2341+
// that is defined to be the same width as a digit.
23382342
const fmtNbElems =
23392343
nbElems < 10 ? `\u{2007}(${nbElems})\u{2007}\u{2007}` :
23402344
nbElems < 100 ? `\u{2007}(${nbElems})\u{2007}` :

0 commit comments

Comments
 (0)