Skip to content

Incorrect font-feature-settings on multiple values for font-variant-numeric #1546

Description

@naiyerasif

Bug description

When I specify multiple values for font-variant-numeric, PostCSS just copies them in font-feature-settings which makes feature declarations invalid.

Source CSS

.lining-nums {
  font-variant-numeric: lining-nums;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.tabular-and-lining-nums {
  font-variant-numeric: tabular-nums lining-nums;
}

Expected CSS

.lining-nums {
  font-feature-settings: "lnum";
  font-variant-numeric: lining-nums;
}

.tabular-nums {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.tabular-and-lining-nums {
  font-feature-settings: "tnum", "lnum";
  font-variant-numeric: tabular-nums lining-nums;
}

Actual CSS

.lining-nums {
  font-feature-settings: "lnum";
  font-variant-numeric: lining-nums;
}

.tabular-nums {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.tabular-and-lining-nums {
  font-feature-settings: tabular-nums lining-nums;
  font-variant-numeric: tabular-nums lining-nums;
}

Playgound example

https://preset-env.cssdb.org/playground/#JTdCJTIyc291cmNlJTIyJTNBJTIyLmxpbmluZy1udW1zJTIwJTdCJTVDbiUyMCUyMGZvbnQtdmFyaWFudC1udW1lcmljJTNBJTIwbGluaW5nLW51bXMlM0IlNUNuJTdEJTVDbiU1Q24udGFidWxhci1udW1zJTIwJTdCJTVDbiUyMCUyMGZvbnQtdmFyaWFudC1udW1lcmljJTNBJTIwdGFidWxhci1udW1zJTNCJTVDbiU3RCU1Q24lNUNuLnRhYnVsYXItYW5kLWxpbmluZy1udW1zJTIwJTdCJTVDbiUyMCUyMGZvbnQtdmFyaWFudC1udW1lcmljJTNBJTIwdGFidWxhci1udW1zJTIwbGluaW5nLW51bXMlM0IlNUNuJTdEJTVDbiUyMiUyQyUyMmNvbmZpZyUyMiUzQSU3QiUyMmJyb3dzZXJzJTIyJTNBJTVCJTIyZGVmYXVsdHMlMjIlNUQlMkMlMjJtaW5pbXVtVmVuZG9ySW1wbGVtZW50YXRpb25zJTIyJTNBMCUyQyUyMnN0YWdlJTIyJTNBMiUyQyUyMmxvZ2ljYWwlMjIlM0ElN0IlMjJpbmxpbmVEaXJlY3Rpb24lMjIlM0ElMjJsZWZ0LXRvLXJpZ2h0JTIyJTJDJTIyYmxvY2tEaXJlY3Rpb24lMjIlM0ElMjJ0b3AtdG8tYm90dG9tJTIyJTdEJTJDJTIycHJlc2VydmUlMjIlM0F0cnVlJTdEJTdE

Does it happen with npx @csstools/csstools-cli <plugin-name> minimal-example.css?

N/A

Debug output

No response

Extra config

No response

What plugin are you experiencing this issue on?

PostCSS Preset Env

Plugin version

10.1.3

What OS are you experiencing this on?

macOS

Node Version

23.5.0

Validations

  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this bug?

  • I'm willing to open a PR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions