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 |
Batman loader | 4,984 Kb |
Content through Media Queries | 9,350 Kb |
CSS 3 progress bar | 2,808 Kb |
Google Fonts Sass Mixin | 4,237 Kb |
Database CRUD JS Class | 4,236 Kb |
Pure CSS button switch | 4,769 Kb |
Off-canvas navigation | 3,864 Kb |
Sass mixin for scrollbar styling | 2,400 Kb |
Pure CSS pie timer | 3,378 Kb |
Synchronise background position with padding | 3,411 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 |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
Learning FlexBox | Alex_rodrigues | 2,821 Kb |
Knob rotation | Alemesre | 2,122 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Mondrian | Chrisarmstrong | 2,787 Kb |
A Pen by Alex Edwards | Exards | 8,218 Kb |
Vue.js Lazy Loading | Kjbrum | 3,620 Kb |
CSS Heart Loaders | Nourabusoud | 2,161 Kb |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Canvas stripes | Adrianparr | 1,948 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!