当前位置:网站首页>Stylelint check error: unexpected missing generic font family font family no missing generic family keyword
Stylelint check error: unexpected missing generic font family font family no missing generic family keyword
2022-07-27 16:41:00 【Blue sky】
problem
stylelint Check and report the following errors :
115:24 × Unexpected missing generic font family font-family-no-missing-generic-family-keyword
Translated into : Accidentally lost generic font family …
intend : It is not allowed to lack generic fonts in the list of used font names
Why?
Should be used at least font-family Add a generic font family name to the list , Because there is no guarantee that the specified font has been installed in the user's computer , There is no guarantee that @font-face The font movement provided can be downloaded correctly . Providing a generic font family allows browsers to use a relatively close alternative font when they cannot get the best font .
resolvent
Add a general font after the currently used font .
font-family grammar
/* A font family name and a generic font family name */
font-family: "Gill Sans Extrabold", sans-serif;
font-family: "Goudy Bookletter 1911", sans-serif;
/* There is only one generic font family name */
font-family: serif;
font-family: sans-serif;
font-family: monospace;
font-family: cursive;
font-family: fantasy;
font-family: system-ui;
font-family: emoji;
font-family: math;
font-family: fangsong;
/* Global value */
font-family: inherit;
font-family: initial;
font-family: unset;
attribute font-family List one or more font families separated by commas . Each font family consists of <family-name> or <generic-name> Value specifies .
The following example lists two font families , The first one is <family-name>, The second is <generic-name>:
font-family: "Gill Sans Extrabold", sans-serif;
font-family Value
<family-name>: The name of a font family . for example ”Times” and “Helvetica” All font family names . Font family names can contain spaces , But you should use quotation marks when you include spaces .<generic-name>: Generic font family names are an alternative mechanism , Used to give a better font when the specified font is not available . Generic font family names are keywords , So you can't use quotation marks . There should be at least one generic font family name at the end of the list . The following are the possible values of this attribute and their definitions .serif:Serif type , There is a special decorative line or serif at the end of the stroke .
for example :Lucida Bright, Lucida Fax, Palatino, “Palatino Linotype”, Palladio, “URW Palladio”, serif.
sans-serif: Sans serif fonts , That is, the end of the stroke is a smooth font .
for example , “Open Sans”, “Fira Sans”, “Lucida Sans”, “Lucida Sans Unicode”, “Trebuchet MS”, “Liberation Sans”, “Nimbus Sans L”, sans-serif.
monospace:Equal width font , That is, the width of each word in the font is the same .
for example , “Fira Mono”, “DejaVu Sans Mono”, Menlo, Consolas, “Liberation Mono”, Monaco, “Lucida Console”, monospace.
cursive:Cursive script . Some of these fonts have ligatures , Some have special italics . Because usually this font has a little brush effect , So it will give people a feeling of handwriting .
for example ,“Brush Script MT“, “Brush Script Std“, “Lucida Calligraphy”, “Lucida Handwriting”, “Apple Chancery”, cursive.
fantasy:Fantasy Fonts are mainly those with special artistic effects .
for example ,Papyrus, Herculanum, Party LET, Curlz MT, Harrington, fantasy.
system-ui:The default user interface font obtained from the platform where the browser is located . Because there are great differences in typesetting habits around the world , This general option is provided for typefaces that don’t map cleanly into the other generics.math:A font designed for the special style problem of displaying mathematical related characters : Subscript and superscript support 、 Straddle brackets 、 Nested expressions and expressions with different meanings double struck glyphs.emoji: Designed to present Emoji Emoticon font .fangsong: A Chinese character font , Between song and regular script . This font is often used in some government documents .
Valid font family name
The family name or the string contained in quotation marks , Or one or more legal identification strings without quotation marks . This means that punctuation characters and numeric characters cannot be used at the beginning of font family names without quotation marks .
for example , The following statement is valid :
font-family: "Gill Sans Extrabold", sans-serif;
font-family: "Goudy Bookletter 1911", sans-serif;
The following statement is invalid :
font-family: Goudy Bookletter 1911, sans-serif;
font-family: Red/Black, sans-serif;
font-family: "Lucida" Grande, sans-serif;
font-family: Ahem!, sans-serif;
font-family: [email protected], sans-serif;
font-family: #POUND, sans-serif;
font-family: Hawaii 5-0, sans-serif;
Official documents
font-family-no-missing-generic-family-keyword:https://stylelint.io/user-guide/rules/list/font-family-no-missing-generic-family-keyword
font-family:https://developer.mozilla.org/zh-CN/docs/Web/CSS/font-family
边栏推荐
- OpenCV(四)——图像特征与目标检测
- The difference and use between get request and post request
- Is low code the future of development? On low code platform
- 2021-03-09
- 获取当前时间的前N天和前后天的数组列表循环遍历每一天
- DRF use: get request to get data (small example)
- Duplicate numbers in array
- Supplement - example of integer programming
- Filament Creator材质编辑工具的实现
- After the cubemx is reconfigured, the generated code cannot be opened successfully with IAR
猜你喜欢

DRF learning notes (V): viewset

Mazak handwheel maintenance Mazak little giant CNC machine tool handle operator maintenance av-eahs-382-1

知网、万方数据库免费下载论文------比连接学校内网速度快数倍不止(有的学校万方数据库不支持下载)

OpenCV(一)——图像基础知识

MySQL high version report SQL_ mode=only_ full_ group_ By exception

Cvxpy - latest issue

Flowable process custom attribute

Insert pictures in word to maintain high DPI method

低代码是开发的未来吗?浅谈低代码平台

kubesphere多节点安装出错
随机推荐
Gpt-2 text generation
从零开始Blazor Server(1)--项目搭建
kubesphere多节点安装出错
TP5 query empty two cases
Product axure9 English version, using repeater repeater to realize drop-down multi selection box
TSMC's 6-nanometer manufacturing process will enter trial production in the first quarter of next year
Replication of complex linked list
Flowable process custom attribute
Solve the problem that ${pagecontext.request.contextpath} is invalid
Rotate string left
CDQ divide and conquer and whole dichotomy learning notes
Segment tree beats~
[paper reading] single- and cross modality near duplicate image pairsdetection via spatial transformer compare
Notes on implementation and acquisition of flowable custom attributes
Supplement - example of integer programming
大数相加
Yys mouse connector
除了「加机器」,其实你的微服务还能这样优化
DRF learning notes (II): Data deserialization
AS更换背景主题以及背景图片