From e4ed63d21001c22b274ac66b17e2ff583dd184d3 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 5 Apr 2024 09:06:57 +0200 Subject: [PATCH 1/3] fix: types --- packages/astro-font/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/astro-font/utils.ts b/packages/astro-font/utils.ts index cef19d2..d38b30a 100644 --- a/packages/astro-font/utils.ts +++ b/packages/astro-font/utils.ts @@ -14,9 +14,9 @@ interface Source { preload?: boolean css?: Record // https://developer.mozilla.org/en-US/docs/Web/CSS/font-style - style: 'normal' | 'italic' | 'oblique' | `oblique ${number}deg` | GlobalValues | {} + style: 'normal' | 'italic' | 'oblique' | `oblique ${number}deg` | GlobalValues | (string & {}) // https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight - weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | GlobalValues | FontWeight | `${FontWeight}` | {} + weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | GlobalValues | FontWeight | `${FontWeight}` | (string & {}) } interface Config { @@ -33,7 +33,7 @@ interface Config { cssVariable?: string | boolean fallback: 'serif' | 'sans-serif' | 'monospace' // https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display - display: 'auto' | 'block' | 'swap' | 'fallback' | 'optional' | {} + display: 'auto' | 'block' | 'swap' | 'fallback' | 'optional' | (string & {}) } export interface Props { From cc5ce6d0e6fcb5f3974189f37a29c1a5a49cf1a2 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 5 Apr 2024 09:12:42 +0200 Subject: [PATCH 2/3] Update utils.ts --- packages/astro-font/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro-font/utils.ts b/packages/astro-font/utils.ts index d38b30a..45a65fe 100644 --- a/packages/astro-font/utils.ts +++ b/packages/astro-font/utils.ts @@ -7,7 +7,7 @@ import { pickFontFileForFallbackGeneration } from './fallback.ts' type GlobalValues = 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' -type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 +type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | (number & {}) interface Source { path: string From 6c9e28776f1bca62e1001932b3b50b47ed499a5d Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 5 Apr 2024 09:15:44 +0200 Subject: [PATCH 3/3] Update utils.ts --- packages/astro-font/utils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/astro-font/utils.ts b/packages/astro-font/utils.ts index 45a65fe..57357da 100644 --- a/packages/astro-font/utils.ts +++ b/packages/astro-font/utils.ts @@ -7,8 +7,6 @@ import { pickFontFileForFallbackGeneration } from './fallback.ts' type GlobalValues = 'inherit' | 'initial' | 'revert' | 'revert-layer' | 'unset' -type FontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | (number & {}) - interface Source { path: string preload?: boolean @@ -16,7 +14,7 @@ interface Source { // https://developer.mozilla.org/en-US/docs/Web/CSS/font-style style: 'normal' | 'italic' | 'oblique' | `oblique ${number}deg` | GlobalValues | (string & {}) // https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight - weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | GlobalValues | FontWeight | `${FontWeight}` | (string & {}) + weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | GlobalValues | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | (string & {}) | (number & {}) } interface Config {