@@ -40,6 +40,7 @@ import { fontFaceToString } from './font/font-face-to-string'
4040import { fontFamilyJoin } from './font/font-family-join'
4141import { fontInspect } from './font/font-inspect'
4242import { fontLoaderScript } from './font/font-loader-script'
43+ import { fontName } from './font/font-name'
4344import { fontNames } from './font/font-names'
4445import { fontResourceHints } from './font/font-resource-hints'
4546import { fontSort } from './font/font-sort'
@@ -53,7 +54,6 @@ import { optimizeAst } from './utilities/optimize-ast'
5354import { reduceGraph } from './utilities/reduce-graph'
5455import { round } from './utilities/round'
5556import { toposort } from './utilities/toposort'
56- import { fontName } from './font/font-name'
5757
5858const findNode = ( node : AstNode ) : AstNode [ ] => {
5959 assert ( node . kind === 'at-rule' )
@@ -88,7 +88,7 @@ const toLang = (locale: string, configuration: Configuration): string => {
8888}
8989
9090const toWebFontLocale = ( styles : Style [ ] , configuration : Configuration ) : Locale => {
91- const prefixes = uniq ( styles . map ( ( value ) => value . prefix ) )
91+ const stacks = uniq ( styles . map ( ( value ) => value . stack ) )
9292
9393 const style = minifyCss (
9494 toCss (
@@ -160,7 +160,7 @@ const toWebFontLocale = (styles: Style[], configuration: Configuration): Locale
160160 fontFace,
161161 fonts : outputFont ,
162162 order,
163- prefixes ,
163+ stacks ,
164164 style,
165165 }
166166
@@ -340,22 +340,22 @@ export const build = async () => {
340340 }
341341
342342 style . propertiesMetrics = {
343- [ `--${ style . prefix } -ascent` ] : round (
343+ [ `--${ style . stack } -ascent` ] : round (
344344 fontPrimaryInformation . ascent / fontPrimaryInformation . unitsPerEm ,
345345 ) ,
346- [ `--${ style . prefix } -cap-height` ] : round (
346+ [ `--${ style . stack } -cap-height` ] : round (
347347 fontPrimaryInformation . capHeight / fontPrimaryInformation . unitsPerEm ,
348348 ) ,
349- [ `--${ style . prefix } -descent` ] : round (
349+ [ `--${ style . stack } -descent` ] : round (
350350 Math . abs ( fontPrimaryInformation . descent / fontPrimaryInformation . unitsPerEm ) ,
351351 ) ,
352- [ `--${ style . prefix } -line-gap` ] : round (
352+ [ `--${ style . stack } -line-gap` ] : round (
353353 fontPrimaryInformation . lineGap / fontPrimaryInformation . unitsPerEm ,
354354 ) ,
355- [ `--${ style . prefix } -x-height` ] : round (
355+ [ `--${ style . stack } -x-height` ] : round (
356356 Math . abs ( fontPrimaryInformation . xHeight / fontPrimaryInformation . unitsPerEm ) ,
357357 ) ,
358- [ `--${ style . prefix } -x-width-average` ] : round (
358+ [ `--${ style . stack } -x-width-average` ] : round (
359359 xWidthAverage ( locales , ...requiredFontInformation ) ,
360360 ) ,
361361 }
@@ -380,7 +380,7 @@ export const build = async () => {
380380
381381 style . propertiesNoScript = pickBy (
382382 {
383- [ `--${ style . prefix } -font-family` ] : fontFamilyJoin ( [
383+ [ `--${ style . stack } -font-family` ] : fontFamilyJoin ( [
384384 ...userFontFamilies . map ( ( value ) => value . fontFamily ) ,
385385 ...localFontFamilies ,
386386 ...genericFontFamilies ,
@@ -391,15 +391,15 @@ export const build = async () => {
391391
392392 style . propertiesLocal = pickBy (
393393 {
394- [ `--${ style . prefix } -font-family` ] : fontFamilyJoin ( [
394+ [ `--${ style . stack } -font-family` ] : fontFamilyJoin ( [
395395 ...localFontFamilies ,
396396 ...genericFontFamilies ,
397397 ] ) ,
398- [ `--${ style . prefix } -font-stretch` ] :
398+ [ `--${ style . stack } -font-stretch` ] :
399399 propertiesUser ?. fontStretch === undefined ? undefined : `${ propertiesUser . fontStretch } %` ,
400- [ `--${ style . prefix } -font-style` ] : propertiesUser ?. fontStyle ,
401- [ `--${ style . prefix } -font-variation-settings` ] : selectorFontVariationSettings ( style ) ,
402- [ `--${ style . prefix } -font-weight` ] : propertiesUser ?. fontWeight ,
400+ [ `--${ style . stack } -font-style` ] : propertiesUser ?. fontStyle ,
401+ [ `--${ style . stack } -font-variation-settings` ] : selectorFontVariationSettings ( style ) ,
402+ [ `--${ style . stack } -font-weight` ] : propertiesUser ?. fontWeight ,
403403 } ,
404404 ( value ) => value !== undefined ,
405405 )
@@ -457,7 +457,7 @@ export const build = async () => {
457457 return styleRule ( selector , [
458458 styleRule (
459459 toLang ( style . locale , configuration ) ,
460- applyStyleAtRules ( style , [ decl ( `--${ style . prefix } -font-family` , fontFamily ) ] ) ,
460+ applyStyleAtRules ( style , [ decl ( `--${ style . stack } -font-family` , fontFamily ) ] ) ,
461461 ) ,
462462 ] )
463463 } ) ,
0 commit comments