Google Fonts Sass Mixin

Developer
Size
4,237 Kb
Views
70,840

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 Previews

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>&nbsp;How to&nbsp;</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>&nbsp;Demo&nbsp;</h2> <ul class="demo"> <li class="first">Hello</li> <li class="second">Hello</li> <li class="third">Hello</li> </ul> <h2>&nbsp;To do&nbsp;</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;
}
Google Fonts Sass Mixin - Script Codes
Google Fonts Sass Mixin - Script Codes
Home Page Home
Developer Hugo Giraudel
Username HugoGiraudel
Uploaded August 09, 2022
Rating 4
Size 4,237 Kb
Views 70,840
Do you need developer help for Google Fonts Sass Mixin?

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!

Hugo Giraudel (HugoGiraudel) Script Codes
Create amazing sales emails with AI!

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!