Web Font Weight and Style Mixin [Code Snippet]


If you are using Google Fonts or a custom web font, you probably are writing different font weights and styles. These mixins combine the two to make it really easy to update a global font style in your stylesheet.

@mixin font-xlight {
font-weight: 200;
font-style: normal;
}

@mixin font-xlight-italic {
font-weight: 200;
font-style: italic;
}

@mixin font-light {
font-weight: 300;
font-style: normal;
}

@mixin font-light-italic {
font-weight: 300;
font-style: italic;
}

@mixin font-book {
font-weight: 400;
font-style: normal;
}

@mixin font-book-italic {
font-weight: 400;
font-style: italic;
}

@mixin font-medium {
font-weight: 500;
font-style: normal;
}

@mixin font-medium-italic {
font-weight: 500;
font-style: italic;
}

@mixin font-bold {
font-weight: 700;
font-style: normal;
}

@mixin font-bold-italic {
font-weight: 700;
font-style: italic;
}

@mixin font-black {
font-weight: 800;
font-style: normal;
}

@mixin font-black-italic {
font-weight: 800;
font-style: italic;
}

 



Written by: Jake Lett
Jake Lett is a results-driven B2B marketing consultant with 15+ years of experience helping businesses boost online visibility, generate qualified leads, and increase sales. Specializing in SEO, HubSpot, and PPC campaign management, Jake leverages proven strategies to deliver measurable growth. As a Certified Google Ads Specialist and HubSpot Developer, he is committed to driving impactful results for his clients.

Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter