https://github.com/lassehaslev/sass-google-fonts
Include google fonts in sass
https://github.com/lassehaslev/sass-google-fonts
css fonts google-fonts helpers sass sass-mixins syntax-sugar web-fonts
Last synced: 3 months ago
JSON representation
Include google fonts in sass
- Host: GitHub
- URL: https://github.com/lassehaslev/sass-google-fonts
- Owner: LasseHaslev
- Created: 2017-12-22T15:02:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-05T10:40:03.000Z (over 4 years ago)
- Last Synced: 2025-04-14T20:17:06.283Z (6 months ago)
- Topics: css, fonts, google-fonts, helpers, sass, sass-mixins, syntax-sugar, web-fonts
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sass-google-fonts [](https://travis-ci.org/LasseHaslev/sass-google-fonts)
> Include google fonts to your projects## Install
```bash
npm install sass-google-fonts
```## Usage
First you need to import the project.
```scss
// Import the project
@import "node_modules/sass-google-fonts/src/GoogleFonts.scss";
```Import your [Google font](https://fonts.google.com/) to your project by entering the font name of the font.
```scss
// Include a google font
@include google-font( 'Tintos' );html, body {
font-family: 'Tintos';
}
```You can also specify the weight and language you want to include as follows.
```scss
// If you want to specify sizes of the font
@include google-font( 'Tintos', '400,400i,700' );// Include languages of fonts
@include google-font( 'Tintos', '400,400i,700', 'greek,latin-ext,vietnamese' );
```## Development
```bash
# Install dependencies
npm install# Run tests one time
npm run test# Run test driven development
npm run tdd
```If you add or change functionality, remember to add tests in [`test/`](https://github.com/LasseHaslev/sass-google-fonts/tree/master/test).
### Publish to npm
> Make sure all tests are successful before publishing to NPM
```bash
# Set the version
npm version {type} # major/minor/patch# Publish to npm
npm publish# Publish to github
git push && git push --tags
```