https://github.com/luckyraul/gulp-base64-woff-css
https://github.com/luckyraul/gulp-base64-woff-css
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/luckyraul/gulp-base64-woff-css
- Owner: luckyraul
- Created: 2015-12-16T20:18:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T20:40:18.000Z (over 9 years ago)
- Last Synced: 2025-01-22T23:25:07.082Z (4 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-google-fonts-base64-css
Gulp plugin to generate css files with Base64 encoded font data from Google Fontsinspired by https://github.com/ygoto3/gulp-base64-webfont-css and https://github.com/battlesnake/gulp-google-webfonts
# Example
### fonts.list
```
# Google format
Roboto:500,500italic&subset=greek
```### gulpfile.js
```
var gulp = require('gulp');
var concat = require('gulp-concat');
var cssmin = require('gulp-minify-css');
var webFontsBase64 = require('gulp-google-fonts-base64-css');
gulp.task('fonts', function () {
return gulp.src('./fonts.list')
.pipe(webFontsBase64())
.pipe(concat('web-fonts.css'))
.pipe(cssmin())
.pipe(gulp.dest('./css'));
});
```## Output
```
@font-face {
font-family: "Roboto";
font-style: normal;
font-weight: 500;
src: local("Roboto"),
url("data:application/x-font-woff;base64,{{base64}}") format("woff");
}
@font-face {
font-family: "Roboto";
font-style: italic;
font-weight: 500;
src: local("Roboto"),
url("data:application/x-font-woff;base64,{{base64}}") format("woff");
}
...
and others```