fix(flags): render flag emoji on Windows globally via a scoped flag font

Windows ships no glyphs for regional-indicator flag emoji, so flags fell back to country letters everywhere react-twemoji wasn't manually wrapped. Bundle the Twemoji country-flags woff2 locally (no runtime CDN — matters for our audience) and add it as an @font-face scoped with unicode-range to flag codepoints only, then put it first in every Tailwind font stack (sans/display/mono). The browser now uses it solely for flag characters, so every flag renders correctly app-wide with zero markup changes and no effect on any other text.
This commit is contained in:
c0mrade
2026-06-01 16:00:28 +03:00
parent 7b7ff53672
commit b877d7f175
3 changed files with 18 additions and 2 deletions

View File

@@ -110,7 +110,11 @@ export default {
},
},
fontFamily: {
// 'Twemoji Country Flags' is first in every stack so Windows renders flag
// emoji (it's unicode-range-scoped to flag codepoints only — see globals.css —
// so it never affects any other glyph). Global root fix for flags everywhere.
sans: [
'Twemoji Country Flags',
'Manrope',
'system-ui',
'-apple-system',
@@ -119,8 +123,8 @@ export default {
'Roboto',
'sans-serif',
],
display: ['Outfit', 'Manrope', 'system-ui', 'sans-serif'],
mono: ['IBM Plex Mono', 'ui-monospace', 'monospace'],
display: ['Twemoji Country Flags', 'Outfit', 'Manrope', 'system-ui', 'sans-serif'],
mono: ['Twemoji Country Flags', 'IBM Plex Mono', 'ui-monospace', 'monospace'],
},
borderRadius: {
bento: '24px',