Normalize.css: Why set font family?

Created on 18 Aug 2017  路  6Comments  路  Source: necolas/normalize.css

https://github.com/necolas/normalize.css/blob/73b6b0c7e8690ab5005bca9d7e13d3fb319c98ac/normalize.css#L245

Why did you do this? This added a headache! I have a custom font in the project and I had to redistribute the entire block ... It's not cool!

Most helpful comment

@unclechu true, but why define sans-serif instead of this?

input {
  font-family: inherit;
}

before this change you could define font-family on html/body and be done with it. Now you'd have to define it for more (which exactly?) elements.

All 6 comments

Agreed, this is not necessary. Why just not to make Class with family standard and just implement it on body page.

You have to set font-family for inputs in any case, font-family for <body> doesn't affect inputs.
You could look at http://www.cssdesk.com/V2Zam that proves it.

I tested it on Firefox 55.0 and Chromium 59.0.3071.104.

@unclechu true, but why define sans-serif instead of this?

input {
  font-family: inherit;
}

before this change you could define font-family on html/body and be done with it. Now you'd have to define it for more (which exactly?) elements.

@oskarrough

you could define font-family on html/body and be done with it

No you couldn't. This is my point.

@unclechu but if we use inherit instead of sans-serif as @oskarrough suggested we would not have to do redeclare later on in our project.

Example: https://jsfiddle.net/9vcdta90/

It's now inherit

Was this page helpful?
0 / 5 - 0 ratings