Google Fonts Sass Mixin
How do I make an google fonts sass mixin?
A little SCSS mixin to ease the use of Google Web Fonts.Any comment or advice welcome.. What is a google fonts sass mixin? How do you make a google fonts sass mixin? This script and codes were developed by Hugo Giraudel on 09 August 2022, Tuesday.
Google Fonts Sass Mixin - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Google Fonts Sass Mixin</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ /* Or directly:
$fonts: Kavoon, Wendy One, Bonbon;
*/
@import url(http://fonts.googleapis.com/css?family=Kavoon|Wendy+One|Bonbon);
.example { font-size: 3em;
}
.first { font-family: Kavoon;
}
.second { font-family: Wendy One;
}
.third { font-family: Bonbon;
}
/* ----------------- DEMO STUFF ------------------- */
* { margin: 0; padding: 0; box-sizing: border-box;
}
html { height: 100%;
}
body { font-size: 20px; font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue","Helvetica","Arial","Lucida Grande",sans-serif; background: silver; height: 100%; padding: 30px;
}
.wrap { width: 700px; padding: 20px 20px 50px 20px; margin: 0 auto; background: white; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
h1 { text-align: center; font-size: 1.6em; padding-bottom: 0.5em; padding-top: 0.5em;
}
h1 span { font-family: Kavoon; font-size: 1.25em;
}
h2 { display: table; font-family: Wendy One; white-space: nowrap; text-align: center; font-size: 1.5em; margin: 1em 0;
}
h2:after, h2:before { content: ""; display: table-cell; width: 50%; background: linear-gradient(#0088cc, #0088cc); background-repeat: repeat-x; background-position: left center; background-size: 4px 5px;
}
span { color: #006699; font-weight: bold;
}
.demo { width: 100%; list-style: none; font-size: 2em; padding: 0; color: #666;
}
.demo:after { content: ''; clear: both; display: table;
}
.demo li { float: left; width: 33%; text-align: center;
}
ul { list-style: disc; padding-left: 1.5em;
}
.how-to { list-style-type: decimal; padding-left: 1.5em;
}
.how-to li { line-height: 1.5;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="wrap"> <h1><span>Sass</span> mixin for <span>Google Web Fonts</span></h1> <h2> How to </h2> <ol class="how-to"> <li>Create a list with unquoted font names,</li> <li>Include the mixin <span>gwf</span>,</li> <li>Use fonts in your stylesheet!</li> </ol> <h2> Demo </h2> <ul class="demo"> <li class="first">Hello</li> <li class="second">Hello</li> <li class="third">Hello</li> </ul> <h2> To do </h2> <ul> <li>Add font-weight to the mixin</li> </ul>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Google Fonts Sass Mixin - Script Codes CSS Codes
/* Or directly:
$fonts: Kavoon, Wendy One, Bonbon;
*/
@import url(http://fonts.googleapis.com/css?family=Kavoon|Wendy+One|Bonbon);
.example { font-size: 3em;
}
.first { font-family: Kavoon;
}
.second { font-family: Wendy One;
}
.third { font-family: Bonbon;
}
/* ----------------- DEMO STUFF ------------------- */
* { margin: 0; padding: 0; box-sizing: border-box;
}
html { height: 100%;
}
body { font-size: 20px; font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue","Helvetica","Arial","Lucida Grande",sans-serif; background: silver; height: 100%; padding: 30px;
}
.wrap { width: 700px; padding: 20px 20px 50px 20px; margin: 0 auto; background: white; box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
h1 { text-align: center; font-size: 1.6em; padding-bottom: 0.5em; padding-top: 0.5em;
}
h1 span { font-family: Kavoon; font-size: 1.25em;
}
h2 { display: table; font-family: Wendy One; white-space: nowrap; text-align: center; font-size: 1.5em; margin: 1em 0;
}
h2:after, h2:before { content: ""; display: table-cell; width: 50%; background: linear-gradient(#0088cc, #0088cc); background-repeat: repeat-x; background-position: left center; background-size: 4px 5px;
}
span { color: #006699; font-weight: bold;
}
.demo { width: 100%; list-style: none; font-size: 2em; padding: 0; color: #666;
}
.demo:after { content: ''; clear: both; display: table;
}
.demo li { float: left; width: 33%; text-align: center;
}
ul { list-style: disc; padding-left: 1.5em;
}
.how-to { list-style-type: decimal; padding-left: 1.5em;
}
.how-to li { line-height: 1.5;
}

Developer | Hugo Giraudel |
Username | HugoGiraudel |
Uploaded | August 09, 2022 |
Rating | 4 |
Size | 4,237 Kb |
Views | 70,805 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Demo Flexbox 3 | 2,822 Kb |
Pure CSS light switch | 4,088 Kb |
CSS temperature controler | 4,789 Kb |
Sass mixin for scrollbar styling | 2,400 Kb |
CSS Dribbble invite request | 9,749 Kb |
List of web resources | 8,824 Kb |
Pure CSS pie timer | 3,378 Kb |
CSS power button | 3,836 Kb |
Single element CSS character | 11,626 Kb |
A Pen by Hugo Giraudel | 3,061 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Beautiful canvas stars | Matths | 2,399 Kb |
Smoke Shader - Frame Buffer | Omarshe7ta | 2,672 Kb |
Fun form with currentColor | Bnthor | 2,713 Kb |
A Pen by lizz | Lizz | 10,068 Kb |
Save for later... | Victorfreire | 1,359 Kb |
BSP Dungeon Generation | Xgundam05 | 5,326 Kb |
Tooltip in table | Roine | 3,713 Kb |
Basecamp 3 Document | Lachlanjc | 3,811 Kb |
Print element on a page | Mrs_snow | 2,081 Kb |
Canvas snow | Win7killer | 2,572 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!