Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 3 tasks
naiyerasif opened this issue Jan 5, 2025 · 1 comment
Open
2 of 3 tasks
Labels

Comments

@naiyerasif
Copy link

naiyerasif commented Jan 5, 2025

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
@romainmenke
Copy link
Member

Hi @naiyerasif

I think this is the same issue as postcss/postcss-font-variant#16

postcss-preset-env contains that plugin.

I will take a closer look at this feature and see if we can improve things.

@romainmenke romainmenke added plugins/postcss-font-variant bug Something isn't working labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants