이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 참여해서 번역을 마치도록 도와 주세요!
English (US)의 문서도 읽어보세요.

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

/* 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);
}

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

Feature value blocks

@swash
Specifies a feature name that will work with the swash() functional notation of font-variant-alternates. A swash feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't.
@annotation
Specifies a feature name that will work with the annotation() functional notation of font-variant-alternates. An annotation feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't.
@ornaments
Specifies a feature name that will work with the ornaments() functional notation of font-variant-alternates. An ornaments feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't.
@stylistic
Specifies a feature name that will work with the stylistic() functional notation of font-variant-alternates. A stylistic feature value definition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't.
@styleset
Specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. A stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the OpenType values ss02, ss04, ss12, and ss01. Note that values higher than 99 are valid, but don't map to any OpenType values and are ignored.
@character-variant
Specifies a feature name that will work with the character-variant() functional notation of font-variant-alternates. A character-variant feature value definition allows either one or two values: ident1: 3 maps to cv03=1, and ident2: 2 4 maps to cv02=4, but ident2: 2 4 5 is invalid.

Formal syntax

@font-feature-values <family-name># {
  <feature-value-block-list>
}

where
<family-name> = <string> | <custom-ident>+
<feature-value-block-list> = <feature-value-block>+

where
<feature-value-block> = <feature-type> { <feature-value-declaration-list> }

where
<feature-type> = @stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation
<feature-value-declaration-list> = <feature-value-declaration>

where
<feature-value-declaration> = <custom-ident>: <integer>+;

Specifications

Specification Status Comment
CSS Fonts Module Level 3
The definition of '@font-feature-values' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@annotation
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@character-variant
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@historical-forms
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@ornaments
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@styleset
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@stylistic
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No
@swash
Experimental
Chrome No support NoEdge No support NoFirefox Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari Full support 9.1WebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 34
Full support 34
Full support 24
Disabled
Disabled From version 24: this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS Full support 9.3Samsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also

문서 태그 및 공헌자

이 페이지의 공헌자: mfluehr, fscholz, Sebastianz, Moyogo, jwhitlock, jsx, HTMLValidator, teoli
최종 변경자: mfluehr,