@next/font
Advanced tools
Comparing version 12.3.2-canary.16 to 12.3.2-canary.17
@@ -16,3 +16,3 @@ "use strict"; | ||
} | ||
const { fontFamily, weight, style, display, preload, selectedVariableAxes, fallback, adjustFontFallback, } = (0, utils_1.validateData)(functionName, data); | ||
const { fontFamily, weight, style, display, preload, selectedVariableAxes, fallback, adjustFontFallback, variable, } = (0, utils_1.validateData)(functionName, data); | ||
const fontAxes = (0, utils_1.getFontAxes)(fontFamily, weight, style, selectedVariableAxes); | ||
@@ -82,5 +82,5 @@ const url = (0, utils_1.getUrl)(fontFamily, fontAxes, display); | ||
fallbackFonts: fallback, | ||
weight: weight === 'variable' ? undefined : weight, | ||
weight: weight === 'variable' ? undefined : Number(weight), | ||
style, | ||
variable: `--next-font-${fontFamily.toLowerCase().replace(/ /g, '-')}${weight !== 'variable' ? `-${weight}` : ''}${style === 'italic' ? `-italic` : ''}`, | ||
variable, | ||
adjustFontFallback: adjustFontFallbackMetrics, | ||
@@ -87,0 +87,0 @@ }; |
@@ -10,2 +10,3 @@ declare type FontOptions = { | ||
adjustFontFallback: boolean; | ||
variable?: string; | ||
}; | ||
@@ -12,0 +13,0 @@ export declare function validateData(functionName: string, data: any): FontOptions; |
@@ -14,3 +14,3 @@ "use strict"; | ||
var _a; | ||
let { variant, display = 'optional', preload = true, axes, fallback, adjustFontFallback = true, } = data[0] || {}; | ||
let { variant, display = 'optional', preload = true, axes, fallback, adjustFontFallback = true, variable, } = data[0] || {}; | ||
if (functionName === '') { | ||
@@ -52,2 +52,3 @@ throw new Error(`@next/font/google has no default export`); | ||
adjustFontFallback, | ||
variable, | ||
}; | ||
@@ -54,0 +55,0 @@ } |
import type { AdjustFontFallback, FontModule } from 'next/font'; | ||
declare type Display = 'auto' | 'block' | 'swap' | 'fallback' | 'optional'; | ||
declare type CssVariable = `--${string}`; | ||
declare type LocalFont = { | ||
@@ -9,7 +10,7 @@ src: string | Array<{ | ||
display?: Display; | ||
weight?: string; | ||
weight?: number; | ||
style?: string; | ||
fallback?: string[]; | ||
preload?: boolean; | ||
variable?: string; | ||
variable?: CssVariable; | ||
fontStretch?: string; | ||
@@ -16,0 +17,0 @@ fontVariant?: string; |
@@ -11,3 +11,3 @@ import { AdjustFontFallback } from 'next/font'; | ||
display: string; | ||
weight?: string; | ||
weight?: number; | ||
style?: string; | ||
@@ -14,0 +14,0 @@ fallback?: string[]; |
{ | ||
"name": "@next/font", | ||
"version": "12.3.2-canary.16", | ||
"version": "12.3.2-canary.17", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "url": "vercel/next.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
600189
22470