@@ -249,10 +249,31 @@ renderVariant var =
249renderVariants typeface =
249renderVariants typeface =
250 case typeface of
250 case typeface of
251 FontWith font ->
251 FontWith font ->
252− String.join ", " (List.map renderVariant font.variants)
252+ Just (String.join ", " (List.map renderVariant font.variants))
260+ VariantActive name ->
266+ VariantIndexed name index ->
267+ name == "smcp" && index == 1
270+hasSmallCaps typeface =
273+ List.any isSmallCaps font.variants
258type Property
279type Property
@@ -2505,7 +2526,7 @@ toStyleSheetString options stylesheet =
2506 features =
2527 features =
2507 typefaces
2528 typefaces
2508− |> List.map renderVariants
2529+ |> List.filterMap renderVariants
2509 |> String.join ", "
2530 |> String.join ", "
2511 families =
2532 families =
@@ -2515,6 +2536,13 @@ toStyleSheetString options stylesheet =
2515 |> String.join ", "
2536 |> String.join ", "
2517 , Property "font-feature-settings" features
2538 , Property "font-feature-settings" features
2539+ , Property "font-variant"
2540+ (if List.any hasSmallCaps typefaces then
2520 String.join " "
2548 String.join " "