0.3.1 • Published 6 years ago

less-plugin-trim-font-face v0.3.1

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

less-plugin-trim-font-face

npm version js-standard-style

Trim useless formats in @font-face of Less files. Compatible with Less v2 and v3.

Promgrammatic usage

const TrimFontFace = require('less-plugin-trim-font-face')

less.render('You less source', {
    plugins: [
        new TrimFontFace({
            'iconfont': ['woff']
        })
    ]
})

It will trim useless font formats but woff if font-family is iconfont in @font-face directives.

For example. If your less source like:

@font-face {
  font-family: "iconfont";
  src: url('/fonts/iconfont.eot?t=1522658144332');
  src: url('/fonts/iconfont.eot?t=1522658144332#iefix') format('embedded-opentype'),
    url('/fonts/iconfont.woff') format('woff'),
    url('iconfont.ttf?t=1522658144332') format('truetype'),
    url('iconfont.svg?t=1522658144332#iconfont') format('svg');
}

You will get output:

@font-face {
  font-family: "iconfont";
  src: url('/fonts/iconfont.woff') format('woff');
}

MIT

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago