Gerillass

v2.1.0

Antialias

Type: Mixin
@include antialias();

* You can call mixins with or without the gls- namespace (e.g. @include gls-antialias();).

The Antialias Sass mixin provides smooth font rendering. It smooths fonts at the pixel level and prevents subpixel rendering.

Arguments

NameTypeDescription
$valuestringAccepts the only value. Use it when you want to apply the styles to one specific HTML element.

Please check out the links at the end of the page for more information about font smoothing.

Examples

If you call it inside a selector without passing a value, the style rules apply to that element and all of its children.

Sass
.element{
  @include antialias;
}
CSS
.element, .element::before, .element::after,
.element *,
.element *::before,
.element *::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Pass the only value as an argument to apply the style rules to only one specific HTML element.

Sass
.element{
  @include antialias(only);
}
CSS
.element, .element::before, .element::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

Call the mixin at the root of your stylesheet to target all the HTML elements.

Sass
@include antialias;
CSS
*,
*::before,
*::after {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}