Re: [css-font-loading] 'family' should be 'fontFamily', to prevent API fragmentation

On Fri, Sep 4, 2015 at 8:41 AM, Mike Kamermans <nihongo@gmail.com> wrote:
> The base JavaScript API for working with CSS in general, where hyphenated
> CSS property names are mirrored as camelCase property names. In the case of
> setting font family, front end devs know this requires
> "element.style.fontFamily = 'Arial, Helvetica, ...';".
>
> So, given that @font-face also uses the "font-family" CSS property, keeping
> this property mirrorred as "fontFamily" on the JS side, to prevent confusion
> for the people who actually have to write front end code on an hourly basis,
> makes a whole lot of sense.

@font-face *doesn't* mirror it as fontFamily.
<https://drafts.csswg.org/css-fonts/#cssfontfacerule>

...or at least, it should.  Hmm, it looks like Chrome and FF, at
least, are ignoring the spec and still implement the DOM Level 2 Style
version.  I'll bring this up in a separate thread.

~TJ

Received on Friday, 4 September 2015 18:12:29 UTC