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
False positives for font-family in font-family-no-missing-generic-family-keyword #3848
Comments
@hirokishirai Thanks for the report and for using the template. I believe this rule is correctly detecting a violation. It ensures that a generic font family is used every time a list of family names is used outside of a To appease the rule you'll need to add a generic font family to your list of family names e.g. [class^="icon-"],
[class*=" icon-"] {
font-family: "my_original_font_family_name", sans-serif !important;
} The list of generic font families can be found in the specification.
That's strange. I'm unable to reproduce this behaviour. I get a violation message regardless of whether the family name is quoted or not. If this problem persists, can you create a reproducible test repo so we can investigate further, please? |
Additionally, if the font is an icon font file then you might also be interested in #3288, which is an issue to add an This will allow you to ignore instances of |
@jeddy3 Thanks for your rapid response.
I fixed with
There were nothing problem about this. I tried skip Sorry for my stupid reporting...! Thanks for your great supporting. |
You can work around this false-positive by abstracting the iconography font-family into a variable:
|
Thanks for sharing your workaround. There is an open issue to add an I've labelled that issue as ready to implement. There are steps on how to add a new option in the Developer guide. |
I had a problem with this after importing Fontawesome SCSS files. Solved by configuring ignoreFontFamilies for the rule like:
|
Hi :) The rule applied to My stylelint config is simple, only extending postcss.config.js
typography.css (some styles are ommited for clarity)
file that is "violating" rule 'font-family-no-missing-generic-family-keyword'
|
@dmrqx Thanks for adding your use case. The option mentioned in #3848 (comment) was added in
The rules built into stylelint as strict by default but can be made more permissive using the optional secondary options. This is one of those cases as stylelint does static analysis of your source code. It doesn't know whether your |
I don't think this works; |
@AndrewKvalheim You are correct. I've created a new issue to ignore by default any values that contain variables (dollar variables, custom properties etc). @dmrqx or @AndrewKvalheim Please consider contributing a fix to that issue if you have time. |
@jeddy3 Thanks for your reply. I'm very sorry for the late response but I had to be away for a while. Moreover, I'd love nothing more than contributing, or to at least try to. |
The new issue was fixed in
That'll be fantastic as new contributors are most welcome! Feel free to jump into any other open issue that interests you. |
Thank you so much it worked for me too :D . I'm happy.
|
Thanks for great work of stylelint community.
There is False positives for font-family in font-family-no-missing-generic-family-keyword(I'm sorry If this is not Bug).
When I specified
font-family
with"my_original_font_family_name" !important
, stylelint showed me bellow error.But, font-family:
"my_original_font_family_name"
is defined by@font-face
.When I specified
font-family
withmy_original_font_family_name !important
(without""
), stylelint test is passed.This issue is similar to #3033 ?
font-family-no-missing-generic-family-keyword
9.9.0
CLI with
stylelint "**/*.scss" --config stylelint.config.js
I guess No.
No warnings in this case.
e.g. "The following warnings were flagged:"
The text was updated successfully, but these errors were encountered: