Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Last active January 12, 2025 12:26
Show Gist options
  • Select an option

  • Save hsleonis/55712b0eafc9b25f1944 to your computer and use it in GitHub Desktop.

Select an option

Save hsleonis/55712b0eafc9b25f1944 to your computer and use it in GitHub Desktop.
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
}
@sreegopi

Copy link
Copy Markdown

It's looking good. thank you :)

@zinchenko

Copy link
Copy Markdown

thanks for the text-shadow thing!

@OZZlE

OZZlE commented Aug 21, 2018

Copy link
Copy Markdown

@dinofx if you have a custom font without many variations using regular anti-aliasing instead of sub-pixel makes the font look thinner, it's a trick I use often when the font I'm using doesn't have a thin variation and in the design looks the font looks thinner :)

@OZZlE

OZZlE commented Aug 21, 2018

Copy link
Copy Markdown

also sub pixel is default now in modern browsers

@CorinLUSI

Copy link
Copy Markdown

would this still be considered the best cross browser font smoothing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment