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,840 |
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 2 | 2,778 Kb |
Social swatchbook | 4,245 Kb |
Pure CSS button switch | 4,769 Kb |
Single element CSS character | 11,626 Kb |
Items on circle | 3,437 Kb |
CSS power button | 3,836 Kb |
Demo Flexbox 1 | 2,388 Kb |
A Pen by Hugo Giraudel | 3,061 Kb |
Off-canvas navigation | 3,864 Kb |
Demo Flexbox 3 | 2,822 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 |
A Pen by Alexandru Pora | Axpro | 1,615 Kb |
Shape Outside - Polygon | Stacy | 3,954 Kb |
Canvas Orbital Trails v2 | Jackrugile | 3,421 Kb |
Css or Czz.. | Judag | 4,111 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
SVG hamburger menu button | Elifitch | 2,602 Kb |
Flat UI - Checkbox FIX | ARS | 2,663 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
Automatic scroll | Skeurentjes | 4,042 Kb |
Knockout Lists | Marinru | 2,531 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!