Skip to content

Instantly share code, notes, and snippets.

@starryeyez024
Last active April 17, 2019 16:26
Show Gist options
  • Save starryeyez024/772f27787a761b035b5f154308a8f98b to your computer and use it in GitHub Desktop.
Save starryeyez024/772f27787a761b035b5f154308a8f98b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<br/>
<p class="lighter">
hello
</p>
<p class="normal">
hello
</p>
<p class="bold">
hello
</p>
// ----
// libsass (v3.5.4)
// ----
//----------------------
// Red Hat Font Mixin
//----------------------
@mixin printRedHatFont(
$weightValue: 400,
$weightName: normal,
$familyName: "RedHatText",
$style: "normal",
$relative: true
) {
$filePath: "./" + $familyName + "/" + $familyName + "-" + $weightName;
@if $relative == false {
$filePath: $fontLocation + "/" + $familyName + "/" + $familyName + "-" + $weightName;
}
@font-face {
font-family: $familyName;
src:
url('#{$filePath}.eot'); /* IE9 Compat Modes */
src:
url('#{$filePath}.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('#{$filePath}.woff') format('woff'); /* Modern Browsers */
//url('#{$filePath}.otf') format('OpenType'), /* Safari, Android, iOS */
//url('#{$filePath}.svg#RedHatDisplay-#{$weightName}') format('svg'); /* Legacy iOS */
font-style: #{$style};
font-weight: $weightValue;
text-rendering: optimizeLegibility;
}
}
//----------------------
// Red Hat Font Usage
//----------------------
// No compiler? No problem! Paste this file into sassmeister.com
// If you would like to load the font from static.redhat.com, use this variable
//$fontLocation: "/";
// and set the $relative argument to false when you call the mixin
//----------------------
// Include the Red Hat Display font
//----------------------
@include printRedHatFont(300, "regular", $familyName: "RedHatDisplay");
@include printRedHatFont(400, "medium", $familyName: "RedHatDisplay");
@include printRedHatFont(700, "bold", $familyName: "RedHatDisplay");
//----------------------
// Include the Red Hat Text font
//----------------------
@include printRedHatFont(400, "regular", $familyName: "RedHatText");
@include printRedHatFont(700, "medium", $familyName: "RedHatText");
// Example Usage
// h2 {
// font-family: "RedHatDisplay";
// font-weight: 700;
// }
@font-face {
font-family: "RedHatDisplay";
src: url("./RedHatDisplay/RedHatDisplay-regular.eot");
/* IE9 Compat Modes */
src: url("./RedHatDisplay/RedHatDisplay-regular.eot?#iefix") format("embedded-opentype"), url("./RedHatDisplay/RedHatDisplay-regular.woff") format("woff");
/* Modern Browsers */
font-style: normal;
font-weight: 300;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "RedHatDisplay";
src: url("./RedHatDisplay/RedHatDisplay-medium.eot");
/* IE9 Compat Modes */
src: url("./RedHatDisplay/RedHatDisplay-medium.eot?#iefix") format("embedded-opentype"), url("./RedHatDisplay/RedHatDisplay-medium.woff") format("woff");
/* Modern Browsers */
font-style: normal;
font-weight: 400;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "RedHatDisplay";
src: url("./RedHatDisplay/RedHatDisplay-bold.eot");
/* IE9 Compat Modes */
src: url("./RedHatDisplay/RedHatDisplay-bold.eot?#iefix") format("embedded-opentype"), url("./RedHatDisplay/RedHatDisplay-bold.woff") format("woff");
/* Modern Browsers */
font-style: normal;
font-weight: 700;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "RedHatText";
src: url("./RedHatText/RedHatText-regular.eot");
/* IE9 Compat Modes */
src: url("./RedHatText/RedHatText-regular.eot?#iefix") format("embedded-opentype"), url("./RedHatText/RedHatText-regular.woff") format("woff");
/* Modern Browsers */
font-style: normal;
font-weight: 400;
text-rendering: optimizeLegibility;
}
@font-face {
font-family: "RedHatText";
src: url("./RedHatText/RedHatText-medium.eot");
/* IE9 Compat Modes */
src: url("./RedHatText/RedHatText-medium.eot?#iefix") format("embedded-opentype"), url("./RedHatText/RedHatText-medium.woff") format("woff");
/* Modern Browsers */
font-style: normal;
font-weight: 700;
text-rendering: optimizeLegibility;
}
<br/>
<p class="lighter">
hello
</p>
<p class="normal">
hello
</p>
<p class="bold">
hello
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment