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

fix: don't override font-family: inherit #113

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Conversation

zanfee
Copy link
Contributor

@zanfee zanfee commented Feb 10, 2023

πŸ”— Linked issue

Fixes nuxt-modules/fontaine#155

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Overriding font-family: inherit to font-family: inherit, "inherit override" leads to an invalid property value. This occured when using Nuxt (reproduction) but not without it (inside fontaine/playground).

The fix is implemented by skipping overrides if the first family is 'inherit' because I assume that only the first family is used to determine the fallback font and there is no need for a separate one if inherits the fallback anyway. Another idea was to filter out 'inherit' like you did with 'var(...' but I think that would lead to it being removed from the entire property value, even if it has no effect on the fallback font.

I was only able to test it by editing the code inside node_modules directly. Would be interesting to know how you would approach fixing this :).

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Overriding `font-family: inherit` to `font-family: inherit, "inherit override"` leads to an invalid property value.

This commit attempts to fix this by skipping overrides if the first family is 'inherit'.
@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (137e1d3) 100.00% compared to head (8aa4fca) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #113   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          151       151           
  Branches        35        35           
=========================================
  Hits           151       151           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

β˜” View full report at Codecov.
πŸ“’ Do you have feedback about the report comment? Let us know in this issue.

@danielroe danielroe changed the title fix: don't override font-family: inherit fix: don't override font-family: inherit Mar 4, 2023
@danielroe danielroe merged commit b08d1de into unjs:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: inherit is also "inherit override"
3 participants