I guess this repo has been superseded by type.js but was just giving it a spin (I only wanted the widow functionality) and figured this info might be useful for someone doing the same:
I noticed that the widow functionality only worked when a line-height is supplied:
No line-height: https://codepen.io/jonjhiggins/pen/WMZdpM
Line-height: https://codepen.io/jonjhiggins/pen/KQXXbd
This looks to be due to Chrome specifying the line-height in JS as 'normal' instead of a number, causing getstyle to return NaN
I guess this repo has been superseded by type.js but was just giving it a spin (I only wanted the widow functionality) and figured this info might be useful for someone doing the same:
I noticed that the widow functionality only worked when a line-height is supplied:
No line-height: https://codepen.io/jonjhiggins/pen/WMZdpM
Line-height: https://codepen.io/jonjhiggins/pen/KQXXbd
This looks to be due to Chrome specifying the line-height in JS as 'normal' instead of a number, causing
getstyleto returnNaN