Comments on: font https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Thu, 22 Sep 2022 21:43:29 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Marc Lafay https://css-tricks.com/almanac/properties/f/font/#comment-1757788 Tue, 16 Jun 2020 10:07:58 +0000 http://css-tricks.com/?page_id=14053#comment-1757788 How declare Google Fonts in the font property ? Usefull to use with variables ($font-base : 300 ‘Roboto’, sans-serif !default;)

]]>
By: Thierry Koblentz https://css-tricks.com/almanac/properties/f/font/#comment-1600730 Tue, 05 Apr 2016 14:05:02 +0000 http://css-tricks.com/?page_id=14053#comment-1600730 Hi Chris,

I think this paragraph (in Mandatory Values section) is misleading:

Two of the values in font shorthand are mandatory: font-size and font-family. If either of these is not included, the entire declaration will be ignored.

Because some keywords will work, for example:

p {
  font-weight:bold;
  font-size: 3em;    
  font: inherit;
}

In the rule above, the third declaration is not ignored. To the contrary, it will reset the font-weight and font-size declarations.

See Section 15.8 Shorthand font property.

]]>
By: Elan https://css-tricks.com/almanac/properties/f/font/#comment-1596194 Wed, 29 Jul 2015 22:15:09 +0000 http://css-tricks.com/?page_id=14053#comment-1596194

However, because we’ve redeclared the font property on the paragraph elements, all the optionals will be reset on the paragraphs, causing the style, variant, weight, and line-height to revert to their initial values.

Would something along the lines of font: 30px/inherit Georgia, sans-serif; fix this in terms of the line-height at least?

]]>
By: May https://css-tricks.com/almanac/properties/f/font/#comment-1594380 Mon, 11 May 2015 19:08:55 +0000 http://css-tricks.com/?page_id=14053#comment-1594380 Why can’t font color be incorporated in the shorthand property?

]]>
By: James Williams https://css-tricks.com/almanac/properties/f/font/#comment-1076009 Sat, 11 Jan 2014 13:33:40 +0000 http://css-tricks.com/?page_id=14053#comment-1076009 Hey there – The Jonathan Snook: font size with rem link has died!

]]>