Skip to content

Instantly share code, notes, and snippets.

@pedronauck
Forked from tableless/gist:5571702
Last active April 29, 2016 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedronauck/5572954 to your computer and use it in GitHub Desktop.
Save pedronauck/5572954 to your computer and use it in GitHub Desktop.
To enhance the legibility of texts in browsers
body {
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
-moz-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
-ms-text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
text-shadow: 0 0 1px rgba(0, 0, 0, 0.01);
-webkit-text-stroke: 1px transparent;
-moz-text-stroke: 1px transparent;
-ms-text-stroke: 1px transparent;
text-stroke: 1px transparent;
}
// -------------------------------------------------------------
// Mixins
// -------------------------------------------------------------
// font-smothing mixin
@mixin font-smothing($method:antialiased) {
-webkit-font-smoothing: $method;
-moz-font-smoothing: $method;
-ms-font-smoothing: $method;
font-smoothing: $method;
}
// text-stroke mixin
@mixin text-stroke($size, $color) {
-webkit-text-stroke: $size $color;
-moz-text-stroke: $size $color;
-ms-text-stroke: $size $color;
text-stroke: $size $color;
}
//text-shadow mixin
@mixin text_shadow($hs, $vs, $br, $color){
-moz-text-shadow: $hs $vs $br $color;
-ms-text-shadow: $hs $vs $br $color;
text-shadow: $hs $vs $br $color;
}
// -------------------------------------------------------------
// Classes
// -------------------------------------------------------------
body {
@include text-shadow(0 0 1px rgba(0, 0, 0, 0.01));
@include text-stroke(1px transparent);
@include font-smothing;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment