css3 - Font-Weight CSS Transition in Chrome -


trying font-weight gracefully transition '400' '600' using css doesn't appear working in chrome. known bug or doing wrong?

check fiddle here example

the problem font weights, when represented numerically, must multiple of 100. animate between 400 , 600, font change 400 500 600 (3 'frames', if like) , wouldn't smooth. animation wouldn't increment weight 1 each time (400, 401, 402...) increment weight 100 (400, 500, 600). if animation lasted 2 seconds, after 1 second weight become 500, , after 2 seconds weight become 600; there no in-between variations.

a further problem you're attempting here font you're using (or jsfiddle's default, @ least) doesn't have different font-weight:500, meaning defaults 400:

<p style="font-weight:400;">a - 400, normal</p> <p style="font-weight:500;">a - 500 (no support, defaults 400)</p> <p style="font-weight:600;">a - 600 (bold)</p> <p style="font-weight:650;">a - 650 (not valid, defaults 400)</p> 

http://jsfiddle.net/r4gdh/6/

numeric font weights fonts provide more normal , bold. if exact weight given unavailable, 600-900 use closest available darker weight (or, if there none, closest available lighter weight), , 100-500 use closest available lighter weight (or, if there none, closest available darker weight). means fonts provide normal , bold, 100-500 normal, , 600-900 bold.

https://developer.mozilla.org/en-us/docs/web/css/font-weight

this means can't smoothly animate font-weight. if had support weights between 100 , 900 change wouldn't pleasant , there dramatic change between 500 , 600 (where lighter weight meets darker weight).


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -