|
| 1 | +/** |
| 2 | + * Reduce CLS using adjusted system font fallback |
| 3 | + * https://screenspan.net/fallback |
| 4 | + * CLI - https://github.com/pixel-point/fontpie |
| 5 | + */ |
| 6 | + |
| 7 | +/* Fallback for Inter */ |
| 8 | +@font-face { |
| 9 | + font-family: "Adjusted Arial Fallback"; |
| 10 | + src: local(arial); |
| 11 | + ascent-override: 94%; |
| 12 | + descent-override: normal; |
| 13 | + line-gap-override: 9%; |
| 14 | + |
| 15 | + size-adjust: 98%; |
| 16 | +} |
| 17 | + |
| 18 | +/** |
| 19 | + * Explore what a font file contains |
| 20 | + * https://wakamaifondue.com/beta/ & https://variable-type-tools.appspot.com/ |
| 21 | + * |
| 22 | + * Optimization & creating subset using |
| 23 | + * https://markoskon.com/creating-font-subsets/#multiple-subsets-by-script |
| 24 | + * |
| 25 | + * Extra learning |
| 26 | + * https://joyofcode.xyz/using-fonts-on-the-web#variable-fonts-are-the-future-of-fonts |
| 27 | + */ |
| 28 | + |
| 29 | +/* All the rest of the characters */ |
| 30 | + |
| 31 | +/* TODO: Use the v4 Inter font */ |
| 32 | +@font-face { |
| 33 | + font-family: InterVar; |
| 34 | + font-weight: 100 900; |
| 35 | + font-style: normal; |
| 36 | + font-display: swap; |
| 37 | + src: url("/fonts/Inter.var-rest.woff2") format("woff2"); |
| 38 | + unicode-range: |
| 39 | + /* stylelint-disable-next-line at-rule-descriptor-value-no-unknown */ U+0259, |
| 40 | + U+0300-03C0, U+2070-2073, U+2075-20AB, \u+20ad-2121, U+2123-218F, |
| 41 | + U+21BC-2211, U+2213-2214, U+2216-F8FE, \u+fb01-fb02; |
| 42 | +} |
| 43 | + |
| 44 | +@font-face { |
| 45 | + font-family: InterVar; |
| 46 | + font-weight: 100 900; |
| 47 | + font-style: normal; |
| 48 | + font-display: swap; |
| 49 | + src: url("/fonts/Inter.var-latin-extended-additional.woff2") format("woff2"); |
| 50 | + unicode-range: U+1E00-1EFF; |
| 51 | +} |
| 52 | + |
| 53 | +/* Latin b glyph */ |
| 54 | +@font-face { |
| 55 | + font-family: InterVar; |
| 56 | + font-weight: 100 900; |
| 57 | + font-style: normal; |
| 58 | + font-display: swap; |
| 59 | + src: url("/fonts/Inter.var-extended-b.woff2") format("woff2"); |
| 60 | + unicode-range: U+0180-024F; |
| 61 | +} |
| 62 | + |
| 63 | +/* Latin a glyph */ |
| 64 | +@font-face { |
| 65 | + font-family: InterVar; |
| 66 | + font-weight: 100 900; |
| 67 | + font-style: normal; |
| 68 | + font-display: swap; |
| 69 | + src: url("/fonts/Inter.var-latin-extended-a.woff2") format("woff2"); |
| 70 | + unicode-range: U+0100-0130, U+0132-0151, U+0154-017F; |
| 71 | +} |
| 72 | + |
| 73 | +/* Rest of the latin removing the English subset */ |
| 74 | +@font-face { |
| 75 | + font-family: InterVar; |
| 76 | + font-weight: 100 900; |
| 77 | + font-style: normal; |
| 78 | + font-display: swap; |
| 79 | + src: url("/fonts/Inter.var-rest-latin.woff2") format("woff2"); |
| 80 | + unicode-range: U+00A1, U+00AA-00AB, U+00AF, U+00B8, U+00BB, U+00BF-00D6, |
| 81 | + U+00D8-00F6, U+00F8-00FF, U+0131, U+0152-0153, U+02B0-02FF; |
| 82 | +} |
| 83 | + |
| 84 | +/* Place the English subset last */ |
| 85 | +@font-face { |
| 86 | + font-family: InterVar; |
| 87 | + font-weight: 100 900; |
| 88 | + font-style: normal; |
| 89 | + font-display: swap; |
| 90 | + src: url("/fonts/Inter.var-english.woff2") format("woff2"); |
| 91 | + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, |
| 92 | + U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, |
| 93 | + U+FEFF, U+FFFD; |
| 94 | +} |
| 95 | + |
1 | 96 | @tailwind base; |
2 | 97 |
|
3 | 98 | html { |
4 | 99 | @apply antialiased; |
5 | 100 | font-size: 16px; |
| 101 | + font-variation-settings: "opsz" 32; |
6 | 102 | font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1, "ss06" 1; |
7 | 103 | -webkit-tap-highlight-color: transparent; |
8 | 104 | } |
|
0 commit comments