Slashed zeros
So when I was starting off creating this website of my own, I encountered a minor problem — my zeros were slashed
Here’s a comparison of before and after:
Markdown table
As I found out, the issue was with the template I was using — Eleventy-Duo
Digging into everything related to fonts, I found this CSS setting in the template:
1
2
3
4
5
6
7
8
9
10
11
12
body {
font-size: var(--text-lg);
line-height: 1.54;
color: var(--color);
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
font-feature-settings: 'liga', 'tnum', 'case', 'calt', 'zero', 'ss01', 'locl';
font-variant-ligatures: contextual;
-webkit-overflow-scrolling: touch;
-webkit-text-size-adjust: 100%;
font-family: -apple-system,BlinkMacSystemFont,segoe ui,Roboto,Oxygen,Ubuntu,Cantarell,open sans,helvetica neue,sans-serif;
}
Pay attention to this:
1
font-feature-settings: 'liga', 'tnum', 'case', 'calt', 'zero', 'ss01', 'locl';
As I found out, font-feature-settings
is a CSS property for tweaking advanced typographic features
- Link to the resource: https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings
And zero
is apparently such a feature, made specifically for differentiating between 0 and O (zero and big ‘o’)
So if you encountered the same issue — unwanted slashed zeros, search for ‘zero’ in your CSS files
This post is licensed under CC BY 4.0 by the author.