Self-host Ubuntu, JetBrains Mono, Roboto and Tourney
Ubuntu becomes the default sans and JetBrains Mono the default mono (via --font-sans / --font-mono, which Tailwind wires to the body and <code> defaults). Roboto and Tourney are opt-in utilities: `font-roboto`, and `font-tourney` for display numerals like jersey numbers. Self-hosted rather than linked from Google's CDN: a CDN <link> sends every visitor's IP to a third party on each page load, which is an avoidable GDPR liability for an EU club platform, and it puts someone else's uptime in our render path. Files come from the @fontsource packages. Two subsets each, with unicode-range: plain `latin` cannot render the Polish, Czech or Turkish letters that turn up in member names, and the range means latin-ext is only fetched by pages that actually contain those glyphs. Tourney is variable on two axes, so font-stretch is declared as a range next to the weight range -- declare only the weight and the browser clamps the width axis to its default, making `font-stretch: 125%` (a wide shirt number) silently do nothing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
48
package-lock.json
generated
48
package-lock.json
generated
@@ -1,16 +1,60 @@
|
||||
{
|
||||
"name": "clubmanager",
|
||||
"name": "rosterchief",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "clubmanager",
|
||||
"name": "rosterchief",
|
||||
"devDependencies": {
|
||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
||||
"@fontsource-variable/roboto": "^5.2.10",
|
||||
"@fontsource-variable/tourney": "^5.2.8",
|
||||
"@fontsource/ubuntu": "^5.2.8",
|
||||
"@tailwindcss/cli": "^4.1.0",
|
||||
"daisyui": "^5.0.0",
|
||||
"tailwindcss": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/jetbrains-mono": {
|
||||
"version": "5.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/jetbrains-mono/-/jetbrains-mono-5.2.8.tgz",
|
||||
"integrity": "sha512-WBA9elru6Jdp5df2mES55wuOO0WIrn3kpXnI4+W2ek5u3ZgLS9XS4gmIlcQhiZOWEKl95meYdvK7xI+ETLCq/Q==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/roboto": {
|
||||
"version": "5.2.10",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/roboto/-/roboto-5.2.10.tgz",
|
||||
"integrity": "sha512-LJ0iLg6aHbLzN515gyHzmdTqJzd9NlI95cCg1DW0F5G7KkFqRLBBKBbqEJx4nSu4aby3IKmw3ZH6Fe928IfaSQ==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource-variable/tourney": {
|
||||
"version": "5.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/tourney/-/tourney-5.2.8.tgz",
|
||||
"integrity": "sha512-jCKjAoSZGylpe8a3GWL5f94pUGDJf2wwvNCleLOPXNE63HOQz6wWis/YJs9sT6Qm0dgLLlBT5712mOLFj0YsSw==",
|
||||
"dev": true,
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/ubuntu": {
|
||||
"version": "5.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/ubuntu/-/ubuntu-5.2.8.tgz",
|
||||
"integrity": "sha512-esSJCpgigwWOm4Ug9f7AMozUyBq5Iobea5C9QYsl2OlCb62wZABBUbXahHLdFv5Ru4lJCD9tUX6xEAeLwUTNBg==",
|
||||
"dev": true,
|
||||
"license": "UFL-1.0",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
"watch": "tailwindcss -i ./static/src/app.css -o ./static/css/app.css --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fontsource-variable/jetbrains-mono": "^5.2.8",
|
||||
"@fontsource-variable/roboto": "^5.2.10",
|
||||
"@fontsource-variable/tourney": "^5.2.8",
|
||||
"@fontsource/ubuntu": "^5.2.8",
|
||||
"@tailwindcss/cli": "^4.1.0",
|
||||
"daisyui": "^5.0.0",
|
||||
"tailwindcss": "^4.1.0"
|
||||
|
||||
3528
static/css/app.css
3528
static/css/app.css
File diff suppressed because one or more lines are too long
BIN
static/fonts/jetbrains-mono-latin-ext-wght-normal.woff2
Normal file
BIN
static/fonts/jetbrains-mono-latin-ext-wght-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/jetbrains-mono-latin-wght-normal.woff2
Normal file
BIN
static/fonts/jetbrains-mono-latin-wght-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/roboto-latin-ext-standard-normal.woff2
Normal file
BIN
static/fonts/roboto-latin-ext-standard-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/roboto-latin-standard-normal.woff2
Normal file
BIN
static/fonts/roboto-latin-standard-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/tourney-latin-ext-standard-normal.woff2
Normal file
BIN
static/fonts/tourney-latin-ext-standard-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/tourney-latin-standard-normal.woff2
Normal file
BIN
static/fonts/tourney-latin-standard-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-400-italic.woff2
Normal file
BIN
static/fonts/ubuntu-latin-400-italic.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-400-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-400-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-500-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-500-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-700-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-700-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-ext-400-italic.woff2
Normal file
BIN
static/fonts/ubuntu-latin-ext-400-italic.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-ext-400-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-ext-400-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-ext-500-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-ext-500-normal.woff2
Normal file
Binary file not shown.
BIN
static/fonts/ubuntu-latin-ext-700-normal.woff2
Normal file
BIN
static/fonts/ubuntu-latin-ext-700-normal.woff2
Normal file
Binary file not shown.
@@ -11,6 +11,161 @@
|
||||
themes: light --default, dark --prefersdark;
|
||||
}
|
||||
|
||||
/* Fonts are self-hosted (files copied from the @fontsource packages into
|
||||
static/fonts/, paths are relative to the built css at /static/css/app.css).
|
||||
Google's CDN would leak every visitor's IP to a third party on page load,
|
||||
which we don't want to inherit for an EU club platform.
|
||||
|
||||
Two subsets each: `latin` covers western europe, `latin-ext` carries the
|
||||
polish/czech/turkish letters that turn up in member names. The unicode-range
|
||||
means a browser only fetches latin-ext when a page actually uses those glyphs.
|
||||
|
||||
Ubuntu is static (it has no variable version); its real weights are 400/500/700,
|
||||
so `font-semibold` (600) is synthesised up to 700 by the browser. JetBrains Mono
|
||||
and Roboto are variable: one file covers the whole weight axis. */
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-400-normal.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-ext-400-normal.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-400-italic.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-ext-400-italic.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-500-normal.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-ext-500-normal.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-700-normal.woff2") format("woff2");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Ubuntu";
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url("../fonts/ubuntu-latin-ext-700-normal.woff2") format("woff2");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-style: normal;
|
||||
font-weight: 100 800;
|
||||
font-display: swap;
|
||||
src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "JetBrains Mono";
|
||||
font-style: normal;
|
||||
font-weight: 100 800;
|
||||
font-display: swap;
|
||||
src: url("../fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Roboto";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("../fonts/roboto-latin-standard-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Roboto";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-display: swap;
|
||||
src: url("../fonts/roboto-latin-ext-standard-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
/* Tourney is a display face for jersey numbers and the like. Its variable file
|
||||
carries two axes -- weight 100-900 and width 75-125 -- so font-stretch has to be
|
||||
declared as a range too, otherwise the browser clamps to the default width and
|
||||
`font-stretch: 125%` (a wide shirt number) silently does nothing. */
|
||||
@font-face {
|
||||
font-family: "Tourney";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-stretch: 75% 125%;
|
||||
font-display: swap;
|
||||
src: url("../fonts/tourney-latin-standard-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Tourney";
|
||||
font-style: normal;
|
||||
font-weight: 100 900;
|
||||
font-stretch: 75% 125%;
|
||||
font-display: swap;
|
||||
src: url("../fonts/tourney-latin-ext-standard-normal.woff2") format("woff2-variations");
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
|
||||
/* Setting --font-sans / --font-mono changes the body and <code> defaults; every
|
||||
--font-* also generates a utility, so --font-roboto gives us `font-roboto` to
|
||||
opt into Roboto where we want it. */
|
||||
@theme {
|
||||
--font-sans: "Ubuntu", ui-sans-serif, system-ui, sans-serif;
|
||||
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
|
||||
--font-ubuntu: "Ubuntu", ui-sans-serif, system-ui, sans-serif;
|
||||
--font-roboto: "Roboto", ui-sans-serif, system-ui, sans-serif;
|
||||
--font-tourney: "Tourney", ui-sans-serif, system-ui, sans-serif;
|
||||
}
|
||||
|
||||
[data-theme="light"] .logo {
|
||||
content: var(--logo-dark);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user