Code Monkey home page Code Monkey logo

fonts-fontface's Introduction

fonts-fontface

Load and Import Specific CSS Open Source Fonts into your projects using Node Package Manager...

Importing Fonts now made easier... Import and load only the needed fonts varaitions for your fonts.

What does this package do?

  • Load and import only the Fonts needed.
  • Enhance app speed, performance and offline use.

As an example: my CSS theme works with Roboto font with variations 300,400,500,700. All I have to do is import that specific font and it's variations.

This package does just that for you.

History

This service was inspired by Kyle Mathews's Typefaces project in which all the fonts variations were all loaded together which caused reduction in performance due to large downloaded fonts.

Usage

Just the way you can do the below with Google Fonts:.

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500italic,700&display=swap" />

You can now do the same with npm:

npm install --save font-face-roboto

Each font-fontface come bundled with all necessary font files.

To use in your project, add and import it in your entry-point:

import "typeface-roboto/300-400-500i-700.css";

Doing the above will import Roboto font with variations of 300normal, 400normal, 500italic and 700normal only.

Typeface assumes you’re using webpack with loaders setup for loading css and font files (you can use Typeface with other setups but webpack makes things really really simple). Assuming your webpack configuration is setup correctly you then just need to require the typeface in the entry file for your project.

Note

Use together with webpack in order to bundle and inject the necessary files into the the project.

Tools like Create-React-App and Gatsby works out-of-the box together with this.

Feel free to use in your react projects.

Contributions

Supports and contributions to this project are highly appreciated!!!

fonts-fontface's People

Contributors

gideonpraise avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.