grunt-font-base64:生成具有WOFF(2)谷歌字体且嵌入为Base64CSS文件

  • k7_287468
    了解作者
  • 18.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 04:37
    上传日期
Grunt FontBase64 生成具有WOFF(2)谷歌字体且嵌入为Base64CSS文件 安装 npm i grunt-font-base64 --save-dev 用法 使用前请先阅读问题 设定档 font_base64: { options : { dest : './src/html/fonts' // generate styles and fonts folder } , all : { fonts : [ 'Gruntfile.js' , 'http://fonts.googleapis.com/css?family=Droid+Sans:700' , 'http://fonts.googleapis.com/css?family=Droid+
grunt-font-base64-master.zip
  • grunt-font-base64-master
  • .travis.yml
    208B
  • bin
  • jasmine_node
    84B
  • LICENSE-MIT
    1.1KB
  • package.json
    1.4KB
  • tasks
  • font_base64.js
    4.9KB
  • services
  • parseurl.js
    6.7KB
  • optimize.js
    3.2KB
  • download.js
    3.3KB
  • tasks.json
    73B
  • .csslintrc
    953B
  • Gruntfile.js
    364B
  • .istanbul.yml
    1.2KB
  • spec
  • src
  • font_base64.spec.js
    8.9KB
  • spec.tpl
    635B
  • .gitignore
    2.8KB
  • CHANGELOG.md
    333B
  • README.md
    2.1KB
  • .jshintrc
    806B
  • .editorconfig
    232B
  • grunt
  • watch.js
    203B
  • jasmine_node.js
    302B
  • jshint.js
    175B
  • font_base64.js
    502B
  • aliases.yml
    88B
  • bump.js
    642B
  • .gitattributes
    565B
内容介绍
# Grunt FontBase64 [![Built with Grunt][grunt-img]](http://gruntjs.com/) [![MIT License][license-img]][license-url] [![NPM version][npm-version-img]][npm-url] [![NPM downloads][npm-downloads-img]][npm-url] [![Build][travis-img]][travis-url] * Generates CSS files with WOFF(2) google fonts embedded as Base64 ## Install ```bash npm i grunt-font-base64 --save-dev ``` ## Usage > **Read the issues before use** ### Config ```javascript font_base64: { options: { dest: './src/html/fonts' // generate styles and fonts folder }, all: { fonts: [ 'Gruntfile.js', 'http://fonts.googleapis.com/css?family=Droid+Sans:700', 'http://fonts.googleapis.com/css?family=Droid+Sans', 'http://fonts.googleapis.com/css?family=Open+Sans', 'http://fonts.googleapis.com/css?family=Droid+Sans:400,700', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' ] } } ``` ***Droid Sans*** will not be duplicated<br/> ***Gruntfile.js*** will not fail and not be encoding of course...<br/> ### Command Line ```bash grunt font_base64 --debug ``` ## Issues - Not tested - woff and woff2 format only - Ouput folder is not setted via Gruntfile - Output folder is completely deleted (./build/fonts, ./build/styles) - @TODO Downloaded fonts must be in a font-family sub folder [grunt-img]: https://cdn.gruntjs.com/builtwith.png [license-img]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square [license-url]: LICENSE-MIT [npm-url]: https://npmjs.org/package/grunt-font-base64 [npm-version-img]: http://img.shields.io/npm/v/grunt-font-base64.svg?style=flat-square [npm-downloads-img]: http://img.shields.io/npm/dm/grunt-font-base64.svg?style=flat-square [coverall-url]: https://coveralls.io/r/sixertoy/grunt-font-base64 [coverall-img]: https://img.shields.io/coveralls/sixertoy/grunt-font-base64.svg?style=flat-square [travis-url]: https://travis-ci.org/sixertoy/grunt-font-base64 [travis-img]: http://img.shields.io/travis/sixertoy/grunt-font-base64.svg?style=flat-square
评论
    相关推荐