CSS font-smooth Property

The non-standard font-smooth property was proposed to influence how browsers smooth the edges of rendered text.

Font smoothing, also called antialiasing, reduces the jagged appearance of character edges by blending pixels along glyph boundaries. The unprefixed font-smooth property is not part of a current CSS standard and is not supported as a reliable cross-browser feature. Some browsers provide limited vendor-prefixed alternatives, particularly on macOS.

font-smooth Syntax

The historical, non-standard font-smooth syntax includes the keywords auto, never, and always, as well as length values. These values should not be treated as interoperable CSS.

Basic Syntax

selector {
  font-smooth: auto;
}

Disable Smoothing

selector {
  font-smooth: never;
}

Request Smoothing

selector {
  font-smooth: always;
}

Historical Length Syntax

selector {
  font-smooth: 16px;
}

The length form was intended to represent a threshold related to font smoothing. It has no dependable behavior in modern browsers.

Vendor-Prefixed Alternatives

selector {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

These are separate, non-standard properties. They do not implement the historical font-smooth syntax and have platform-specific behavior.

Property Values

The following values describe the historical intent of the unprefixed property rather than a supported modern CSS interface.

Value Historical Meaning
auto Allows the browser or operating system to determine whether smoothing is applied.
never Requests that font smoothing not be applied.
always Requests that font smoothing be applied.
<length> Historically described a font-size threshold associated with smoothing.

Historical Property Characteristics

Characteristic Value
Standard status Non-standard
Initial value auto in historical descriptions
Inherited Described as inherited in historical references
Modern browser support No interoperable support for the unprefixed property
Animation type Not standardized
Specification No current CSS specification defines this property

Because font-smooth is not standardized, these historical characteristics do not establish required behavior for modern browsers.

How It Works

Text rendering involves converting font outlines into pixels. Antialiasing can soften the appearance of curved and diagonal edges by using intermediate pixel colors or intensities.

Font Outlines

Many fonts describe glyphs using vector outlines. The browser's text rendering system converts those outlines into pixels for display.

Pixel Coverage

At a glyph boundary, a pixel may be only partially covered by the character. Antialiasing uses this coverage information to create smoother-looking edges.

Platform Rendering

The final appearance depends on the browser, operating system, display characteristics, font, and text rendering configuration.

CSS Limitations

Modern CSS does not provide a standardized property that directly selects every aspect of the operating system's font antialiasing method.

Important Consideration

Adding font-smooth to a stylesheet does not guarantee any visual change. Browsers that do not recognize it ignore the declaration.

The auto Value

The historical auto value was intended to let the browser determine how font smoothing should be handled.

Example

.text {
  font-smooth: auto;
}

Expected Intent

The rendering system would choose an appropriate smoothing behavior according to its normal text rendering rules.

Modern Behavior

Because the unprefixed property is not supported as an interoperable feature, the declaration does not reliably control font rendering.

Important Consideration

Leaving font smoothing to the browser and operating system is generally the most predictable approach for ordinary website text.

The never Value

The historical never value was intended to request text rendering without font smoothing.

Example

.pixel-text {
  font-smooth: never;
}

Intended Appearance

Without antialiasing, character edges may appear more sharply stepped, particularly along curves and diagonal strokes.

Modern Behavior

The declaration is not a dependable way to disable antialiasing in modern browsers.

Important Consideration

For intentionally pixelated typography, use a font designed for pixel-based rendering rather than relying on an unsupported smoothing property.

The always Value

The historical always value was intended to request font smoothing regardless of the font size.

Example

.smooth-text {
  font-smooth: always;
}

Intended Appearance

Antialiasing can make curved and diagonal letter edges appear less jagged by blending pixels along glyph boundaries.

Modern Behavior

The unprefixed declaration is not supported as a reliable method of enabling font smoothing.

Important Consideration

Most modern browsers already use antialiased text rendering where appropriate. Adding font-smooth: always does not provide a standardized improvement.

Vendor-Prefixed Alternatives

Some browsers expose non-standard, vendor-prefixed properties that influence font smoothing on particular operating systems.

Available Alternatives

Property Purpose
-webkit-font-smoothing Controls certain font smoothing behavior in WebKit-based environments, particularly on macOS.
-moz-osx-font-smoothing Controls certain font smoothing behavior in Firefox on macOS.

Example

.heading {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Platform Dependency

These properties are not guaranteed to work on Windows, Linux, or mobile operating systems. Their effects can also vary with browser versions and rendering configurations.

Important Consideration

Vendor prefixes do not make the feature standardized. Treat these declarations as optional visual refinements rather than essential styling requirements.

-webkit-font-smoothing

The non-standard -webkit-font-smoothing property provides limited control over font smoothing in supported WebKit environments.

Common Values

Value Description
auto Uses the browser's normal smoothing behavior.
none Requests no font smoothing where supported.
antialiased Requests grayscale antialiasing where supported.
subpixel-antialiased Historically requested subpixel antialiasing where available.

Grayscale Antialiasing

.heading {
  -webkit-font-smoothing: antialiased;
}

Default Rendering

.heading {
  -webkit-font-smoothing: auto;
}

Important Consideration

On modern macOS systems, subpixel antialiasing may be unavailable regardless of the requested value. The browser and operating system ultimately determine the rendering method.

-moz-osx-font-smoothing

The non-standard -moz-osx-font-smoothing property controls certain font smoothing behavior in Firefox on macOS.

Available Values

Value Description
auto Uses the default font smoothing behavior.
grayscale Requests grayscale antialiasing.

Grayscale Example

.heading {
  -moz-osx-font-smoothing: grayscale;
}

Default Rendering

.heading {
  -moz-osx-font-smoothing: auto;
}

Combining Vendor-Prefixed Properties

.heading {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Important Consideration

This property is specific to Firefox's macOS rendering behavior. It is not a general-purpose smoothing control for all Firefox platforms.

Antialiasing Methods

Different rendering systems use different techniques to make text edges appear smoother.

Grayscale Antialiasing

Grayscale antialiasing blends the text color with the background using varying pixel opacity or intensity along character edges.

Subpixel Antialiasing

Subpixel antialiasing historically used the individual red, green, and blue components of display pixels to increase apparent horizontal resolution.

Comparison

Method Characteristics
Grayscale antialiasing Blends glyph edges without relying on the display's individual color subpixel arrangement.
Subpixel antialiasing Uses display subpixel information and depends on compatible rendering conditions.
No antialiasing Renders edges without intermediate smoothing, which may create visible stair-step patterns.

Modern Display Rendering

High-density displays can make text appear smooth without relying on older subpixel rendering techniques. Operating systems may also disable or restrict certain methods.

Important Consideration

CSS cannot guarantee that a particular antialiasing technique will be used across every browser, operating system, and display.

Font Smoothing and Font Weight

Font smoothing can influence the apparent thickness of letter strokes, but it does not change the font's actual weight.

Using font-weight

.heading {
  font-weight: 600;
}

The font-weight property selects the requested weight from the available font faces or variable font range.

Using Grayscale Smoothing

.heading {
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

Where supported, grayscale antialiasing may make strokes appear lighter or thinner than the browser's default rendering.

Comparison

Feature Effect
font-weight Changes the selected font weight.
Font smoothing Changes how glyph edges are rasterized where supported.

Important Consideration

If text appears too light, choose an appropriate font weight instead of relying on non-standard smoothing declarations to alter its appearance.

Readability and Accessibility

Font smoothing is only one factor affecting text readability. Font size, weight, spacing, contrast, and line height are usually more dependable controls.

Use Readable Font Sizes

body {
  font-size: 1rem;
}

Maintain Sufficient Contrast

body {
  color: #222222;
  background-color: #ffffff;
}

Use Appropriate Line Height

p {
  line-height: 1.6;
}

Avoid Excessively Thin Text

.body-text {
  font-weight: 400;
}

Very thin font weights can become difficult to read, particularly at small sizes or on displays with different rendering characteristics.

Important Consideration

Non-standard font smoothing should not be used as a substitute for accessible typography. Test text readability with browser zoom, different displays, and user-selected font settings.

font-smooth Example

This example compares the browser's default font rendering with vendor-prefixed grayscale smoothing requests.

The demonstration does not use the unprefixed font-smooth property because it has no reliable modern browser support. The vendor-prefixed declarations may produce a visible difference on supported macOS browsers, but the examples can look identical elsewhere.

HTML Example

<div class="font-smooth-demo">
  <p class="demo-label">Default font rendering</p>
  <p class="default-text">Smooth Typography</p>
  <p class="demo-label">Grayscale smoothing requested</p>
  <p class="smoothed-text">Smooth Typography</p>
  <p class="demo-label">Default rendering on a dark background</p>
  <div class="dark-panel">
    <p class="dark-default">Smooth Typography</p>
  </div>
  <p class="demo-label">Grayscale smoothing on a dark background</p>
  <div class="dark-panel">
    <p class="dark-smoothed">Smooth Typography</p>
  </div>
</div>

CSS Example

.font-smooth-demo {
  font-family: Arial, sans-serif;
}
.font-smooth-demo p {
  margin: 0 0 12px;
}
.font-smooth-demo .demo-label {
  font: 600 13px/1.4 Arial, sans-serif;
}
.font-smooth-demo .default-text,
.font-smooth-demo .smoothed-text {
  font-size: 30px;
  font-weight: 600;
}
.font-smooth-demo .default-text {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}
.font-smooth-demo .smoothed-text {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.font-smooth-demo .dark-panel {
  background-color: #252a32;
  padding: 16px;
  margin-bottom: 14px;
}
.font-smooth-demo .dark-panel p {
  color: #ffffff;
  font-size: 30px;
  font-weight: 600;
  margin: 0;
}
.font-smooth-demo .dark-default {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}
.font-smooth-demo .dark-smoothed {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
Browser Result

Default font rendering

Smooth Typography

Grayscale smoothing requested

Smooth Typography

Default rendering on a dark background

Smooth Typography

Grayscale smoothing on a dark background

Smooth Typography

The default examples use the browser's normal font rendering. The other examples request grayscale antialiasing through vendor-prefixed properties.

On platforms that ignore these declarations or already use grayscale antialiasing, the text may appear identical. This is expected and illustrates why font smoothing cannot be controlled consistently through CSS.

Common Mistakes

The most common mistake is assuming that font-smooth is a standard CSS property with dependable browser support.

Assuming the Unprefixed Property Is Supported

p {
  font-smooth: always;
}

Modern browsers generally ignore this non-standard declaration.

Using Unsupported Values with Vendor Prefixes

p {
  -webkit-font-smoothing: always;
}

The historical always value is not part of the -webkit-font-smoothing value set.

Expecting the Same Appearance Everywhere

Font rendering differs between browsers, operating systems, displays, and rendering configurations.

Assuming Grayscale Smoothing Makes Text Bolder

Grayscale antialiasing can make some fonts appear lighter. Use font-weight to select a heavier font weight.

Applying Smoothing to All Text Without Testing

* {
  -webkit-font-smoothing: antialiased;
}

A universal smoothing declaration may alter text appearance on supported platforms without improving readability. Test the actual fonts and sizes before applying it broadly.

Using Smoothing to Fix Poor Contrast

Antialiasing does not replace sufficient foreground and background contrast.

Confusing Font Smoothing with Font Weight

Font smoothing affects rasterization. Font weight selects the thickness of the font's designed strokes.

Assuming Vendor Prefixes Guarantee Compatibility

Vendor-prefixed properties remain non-standard and may be ignored or behave differently across supported platforms.

Important Considerations

Keep the following points in mind when using the font-smooth property:

  • Purpose: Historically intended to influence font antialiasing.
  • Standard status: The unprefixed property is non-standard.
  • Browser support: No reliable cross-browser support exists for the unprefixed property.
  • Historical values: Include auto, never, always, and length values.
  • Modern behavior: Unsupported declarations are ignored.
  • Vendor alternatives: Include -webkit-font-smoothing and -moz-osx-font-smoothing.
  • Platform dependency: Vendor-prefixed behavior is primarily associated with macOS.
  • Grayscale antialiasing: Blends glyph edges without relying on color subpixel positions.
  • Subpixel antialiasing: Depends on compatible display and rendering conditions.
  • Operating system: System text rendering settings can override or limit smoothing behavior.
  • Font weight: Smoothing does not change the selected font weight.
  • Readability: Grayscale smoothing may make some text appear lighter.
  • Accessibility: Font size, weight, spacing, and contrast remain more important controls.
  • Consistency: Identical CSS may render differently across operating systems.
  • Testing: Evaluate text on the actual browsers and devices used by the website's audience.
  • Recommendation: Prefer default browser font rendering unless a specific, tested visual adjustment is required.

The font-smooth property is primarily useful as a historical reference. For modern websites, use standard typography properties and allow the browser and operating system to manage text antialiasing.

Browser Support

The unprefixed CSS font-smooth property has Limited availability and is not supported as a standardized, interoperable feature in modern browsers.

Some browsers provide vendor-prefixed alternatives with limited platform-specific behavior.

Compatibility Overview

Property Compatibility
font-smooth Non-standard and not reliably supported.
-webkit-font-smoothing Limited platform-specific support, primarily associated with WebKit on macOS.
-moz-osx-font-smoothing Limited support in Firefox on macOS.

Vendor-Prefixed Example

.heading {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Fallback Behavior

Browsers that do not recognize these declarations ignore them and use their normal text rendering behavior. No additional fallback declaration is required for text to remain visible.

For current compatibility information, visit Can I Use? and search for font-smooth or the relevant vendor-prefixed property.

Specifications

The unprefixed font-smooth property is not defined in a current W3C CSS specification. It should not be treated as a standard CSS Fonts property.

The CSS Fonts Module defines standardized font selection and typography properties, including font-family, font-size, and font-weight.

CSS Fonts Module Level 4

MDN documents the non-standard vendor-prefixed smoothing properties and their platform limitations.

MDN Web Docs: font-smooth

MDN Web Docs: -webkit-font-smoothing

MDN Web Docs: -moz-osx-font-smoothing