I'm adding @font-face rules using IEs stylesheet.addRule() method. However, the @ symbol is a disallowed character for the 'selector' argument of that method so I'm getting a 'invalid argument' error.
s.addrule("@font-face", "font-family: 'Font Name'; src:url('/fonts/font.eot') etc...)";
Is there some other way to dynamically add these rules?
I've tried setting the innerHTML property of the style element, setting the cssText property of the styleSheet property, and appending a text node to the style element as well (which crashes IE).
Any other methods to try?
<!--[if IE]><style type="text/css">@font-face { font-family: 'Font Name'; src: url('/fonts/font.eot'); }</style><![endif]-->@font-faceisn't a valid selector. Take a look at the description of the parameters on msdn.microsoft.com/en-us/library/aa358796(v=vs.85).aspx