fix: font displaying (#120)

This commit was merged in pull request #120.
This commit is contained in:
2026-01-24 11:30:45 +00:00
committed by Gitea
4 changed files with 23 additions and 20 deletions

View File

@@ -1,17 +0,0 @@
@layer base {
@font-face {
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url("/assets/fonts/inter_variable.woff2") format("woff2");
}
@font-face {
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url("/assets/fonts/inter_variable_italic.woff2") format("woff2");
}
}

View File

@@ -12,6 +12,7 @@ services:
- ./Cargo.toml:/srv/app/Cargo.toml - ./Cargo.toml:/srv/app/Cargo.toml
- ./diesel.toml:/srv/app/diesel.toml - ./diesel.toml:/srv/app/diesel.toml
- ./Dioxus.toml:/srv/app/Dioxus.toml - ./Dioxus.toml:/srv/app/Dioxus.toml
- ./tailwind.css:/srv/app/tailwind.css
restart: always restart: always
ports: ["8000:8000"] ports: ["8000:8000"]
depends_on: ["db"] depends_on: ["db"]

View File

@@ -7,13 +7,12 @@ use dioxus_i18n::prelude::*;
use dioxus_i18n::unic_langid::langid; use dioxus_i18n::unic_langid::langid;
const FAVICON: Asset = asset!("/assets/favicon.ico"); const FAVICON: Asset = asset!("/assets/favicon.ico");
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
#[used] #[used]
static FONTS_DIRECTORY: Asset = asset!( static FONTS_DIRECTORY: Asset = asset!(
"/assets/fonts", "/assets/fonts",
AssetOptions::builder().with_hash_suffix(false) AssetOptions::builder().with_hash_suffix(false)
); );
const FONTS_CSS: Asset = asset!("/assets/styles/fonts.css"); const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
const INPUT_NUMBER_ARROWS_CSS: Asset = asset!("/assets/styles/input_number_arrows.css"); const INPUT_NUMBER_ARROWS_CSS: Asset = asset!("/assets/styles/input_number_arrows.css");
const INPUT_RANGE_CSS: Asset = asset!("/assets/styles/input_range.css"); const INPUT_RANGE_CSS: Asset = asset!("/assets/styles/input_range.css");
const MANIFEST: Asset = asset!("/assets/manifest.json"); const MANIFEST: Asset = asset!("/assets/manifest.json");
@@ -35,7 +34,6 @@ pub(crate) fn App() -> Element {
rsx! { rsx! {
document::Link { rel: "icon", href: FAVICON } document::Link { rel: "icon", href: FAVICON }
document::Stylesheet { href: TAILWIND_CSS } document::Stylesheet { href: TAILWIND_CSS }
document::Stylesheet { href: FONTS_CSS }
document::Stylesheet { href: INPUT_NUMBER_ARROWS_CSS } document::Stylesheet { href: INPUT_NUMBER_ARROWS_CSS }
document::Stylesheet { href: INPUT_RANGE_CSS } document::Stylesheet { href: INPUT_RANGE_CSS }
document::Link { rel: "manifest", href: MANIFEST, crossorigin: "use-credentials" } document::Link { rel: "manifest", href: MANIFEST, crossorigin: "use-credentials" }

View File

@@ -1,2 +1,23 @@
/* stylelint-disable-next-line import-notation */ /* stylelint-disable-next-line import-notation */
@import "tailwindcss"; @import "tailwindcss";
@font-face {
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url("/assets/fonts/inter_variable.woff2") format("woff2");
}
@font-face {
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url("/assets/fonts/inter_variable_italic.woff2") format("woff2");
}
/* stylelint-disable-next-line */
@theme {
--font-sans: "Inter", "sans";
}