Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS font-family property IDE (PHPStorm) warning

Tags:

I'm using PHPStorm 8.0.3 and in my CSS file I get warning for font-family rule.

This inspection verifies that the CSS font-family property contains a generic font name as a fallback alternative.

I added the font as follows:

.my_text {     font-family: 'DINPro-Medium'; }  @font-face {     font-family: 'DINPro-Medium';     src: url(font/DINPro-Medium.eot);     src: url(font/DINPro-Medium.eot?#iefix) format('embedded-opentype'),     url(font/DINPro-Medium.ttf) format('truetype'),     url(font/DINPro-Medium.woff) format('woff'),     url(font/DINPro-Medium.svg#DINPro-Medium) format('svg');     font-weight: normal;     font-style: normal; } 

I can not understand what the problem is.

like image 740
Sergey Novikov Avatar asked Jul 13 '15 08:07

Sergey Novikov


People also ask

What is CSS font-family property?

The font-family property specifies a list of fonts, from highest priority to lowest. Font selection does not stop at the first font in the list that is on the user's system.

What does the font-family style property allow you to do?

The font-family property specifies the font for an element. The font-family property can hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.

What is font-family monospace?

The term modern can be used for a fixed-pitch generic font family name, which is used in OpenDocument format (ISO/IEC 26300:2006) and Rich Text Format. Examples of monospaced fonts include Courier, Lucida Console, Menlo, Monaco, Consolas, Inconsolata and Source Code Pro.


2 Answers

It is recommended to add generic font families as a fallback while using a custom font.

Eg. font-family: 'DINPro-Medium', serif;

If the browser fails to load files for your custom font, it will use generic serif font.

like image 150
halfzebra Avatar answered Sep 16 '22 15:09

halfzebra


Uncheck this checkbox which will disable the check:

enter image description here

Settings → Editor → Inspections → CSS → Probable bugs → Missing generic font name

like image 41
Geo Avatar answered Sep 17 '22 15:09

Geo