files/en-us/web/api/cssfontfacerule/index.md
{{APIRef("CSSOM")}}
The CSSFontFaceRule interface represents an {{cssxref("@font-face")}} at-rule.
{{InheritanceDiagram}}
Inherits properties from its ancestor {{domxref("CSSRule")}}.
Inherits methods from its ancestor {{domxref("CSSRule")}}.
This example uses the CSS found as an example on the {{cssxref("@font-face")}} page. The first {{domxref("CSSRule")}} returned will be a CSSFontFaceRule.
@font-face {
font-family: "MyHelvetica";
src:
local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"),
url("MgOpenModernaBold.woff2");
font-weight: bold;
}
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0]); // A CSSFontFaceRule
{{Specifications}}
{{Compat}}