Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

self-hosting fonts

Blue Mouse501cdfce0e4c
diff --git a/app/root.tsx b/app/root.tsx
index 75659cf2a..a31de34ca 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -44,6 +44,7 @@ import tailwindCss from 'styles/tailwind.css'
import FlatpickerCss from 'styles/Flatpicker.css'
import FlatpickrLightCss from 'flatpickr/dist/themes/light.css'
import FlatpickrDarkCss from 'flatpickr/dist/themes/dark.css'
+import FontsCss from 'styles/fonts.css'
trackViews()
@@ -66,16 +67,12 @@ if (isBrowser && process.env.NODE_ENV !== 'production') {
localStorage.debug = 'swetrix:*'
}
-const FONTS_PROVIDER = 'https://fonts.bunny.net'
-const FONTS_URL = 'https://fonts.bunny.net/css?family=inter:300,400,500,600,700,800'
-
export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: tailwindCss },
{ rel: 'stylesheet', href: mainCss },
{ rel: 'stylesheet', href: BillboardCss },
{ rel: 'stylesheet', href: FlatpickerCss },
- { rel: 'preconnect', href: FONTS_PROVIDER },
- { rel: 'stylesheet', href: FONTS_URL },
+ { rel: 'stylesheet', href: FontsCss },
]
export const meta: V2_MetaFunction = () => [
@@ -294,6 +291,12 @@ export default function App() {
))}
<link rel='alternate' href={lnglessUrl} hrefLang='x-default' />
<link rel='preload' href={`/locales/${locale}.json`} as='fetch' type='application/json' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-300.woff2' type='font/woff2' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-regular.woff2' type='font/woff2' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-500.woff2' type='font/woff2' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-600.woff2' type='font/woff2' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-700.woff2' type='font/woff2' crossOrigin='anonymous' />
+ <link rel='preload' as='font' href='/fonts/inter-v13-cyrillic_latin-800.woff2' type='font/woff2' crossOrigin='anonymous' />
<script
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
diff --git a/app/styles/fonts.css b/app/styles/fonts.css
new file mode 100644
index 000000000..6207787ef
--- /dev/null
+++ b/app/styles/fonts.css
@@ -0,0 +1,53 @@
+/* inter-300 - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 300;
+ src: url('/fonts/inter-v13-cyrillic_latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
+
+/* inter-regular - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 400;
+ src: url('/fonts/inter-v13-cyrillic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
+
+/* inter-500 - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 500;
+ src: url('/fonts/inter-v13-cyrillic_latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
+
+/* inter-600 - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 600;
+ src: url('/fonts/inter-v13-cyrillic_latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
+
+/* inter-700 - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 700;
+ src: url('/fonts/inter-v13-cyrillic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
+
+/* inter-800 - cyrillic_latin */
+@font-face {
+ font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
+ font-family: 'Inter';
+ font-style: normal;
+ font-weight: 800;
+ src: url('/fonts/inter-v13-cyrillic_latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
+}
diff --git a/app/styles/index.css b/app/styles/index.css
index 924decd57..e4cabe5f2 100644
--- a/app/styles/index.css
+++ b/app/styles/index.css
@@ -154,7 +154,7 @@ body {
}
html {
- font-family: 'Inter', 'Cantarell', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
+ font-family: 'Inter', 'Cantarell', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Oxygen', 'Ubuntu', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scroll-behavior: smooth;
diff --git a/public/fonts/inter-v13-cyrillic_latin-300.woff2 b/public/fonts/inter-v13-cyrillic_latin-300.woff2
new file mode 100644
index 000000000..121af99a5
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-300.woff2 differ
diff --git a/public/fonts/inter-v13-cyrillic_latin-500.woff2 b/public/fonts/inter-v13-cyrillic_latin-500.woff2
new file mode 100644
index 000000000..3b2507a0e
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-500.woff2 differ
diff --git a/public/fonts/inter-v13-cyrillic_latin-600.woff2 b/public/fonts/inter-v13-cyrillic_latin-600.woff2
new file mode 100644
index 000000000..6664455d8
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-600.woff2 differ
diff --git a/public/fonts/inter-v13-cyrillic_latin-700.woff2 b/public/fonts/inter-v13-cyrillic_latin-700.woff2
new file mode 100644
index 000000000..934017df4
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-700.woff2 differ
diff --git a/public/fonts/inter-v13-cyrillic_latin-800.woff2 b/public/fonts/inter-v13-cyrillic_latin-800.woff2
new file mode 100644
index 000000000..85fef4e77
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-800.woff2 differ
diff --git a/public/fonts/inter-v13-cyrillic_latin-regular.woff2 b/public/fonts/inter-v13-cyrillic_latin-regular.woff2
new file mode 100644
index 000000000..f7a761d9e
Binary files /dev/null and b/public/fonts/inter-v13-cyrillic_latin-regular.woff2 differ