docs.rodeo

MDN Web Docs mirror

@font-feature-values

{{CSSRef}} 

The @font-feature-values CSS at-rule lets you use a common name in the {{cssxref("font-variant-alternates")}}  property for features activated differently in OpenType. This can help simplify your CSS when using multiple fonts.

The @font-feature-values at-rule may be used either at the top level of your CSS or inside any CSS conditional-group at-rule.

Syntax

Each @font-feature-values block contains a list of either feature value blocks (listed below), or the {{cssxref("@font-feature-values/font-display", "font-display")}}  descriptor.

Feature value blocks

Formal syntax

{{csssyntax}} 

Examples

Using @styleset in a @font-feature-values rule

/* At-rule for "nice-style" in Font One */
@font-feature-values Font One {
  @styleset {
    nice-style: 12;
  }
}

/* At-rule for "nice-style" in Font Two */
@font-feature-values Font Two {
  @styleset {
    nice-style: 4;
  }
}

…

/* Apply the at-rules with a single declaration */
.nice-look {
  font-variant-alternates: styleset(nice-style);
}

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN