1.1.1 • Published 6 months ago

postcss-remove-font-face v1.1.1

Weekly downloads
-
License
-
Repository
github
Last release
6 months ago

postcss-remove-font-face

Version Downloads Bundle size

Remove @font-face blocks to avoid downloading fonts and speed up your websites.

Installation

npm install --save-dev postcss-remove-font-face

Examples

PostCSS

Ignore all remote fonts:

// postcss.config.ts
import postcssRemoveFontFace from 'postcss-remove-font-face';

export default {
  plugins: [postcssRemoveFontFace()],
};

Ignore all remote fonts, except for iconfont:

// postcss.config.ts
import postcssRemoveFontFace from 'postcss-remove-font-face';

export default {
  plugins: [
    postcssRemoveFontFace({
      fontFamilyWhiteList: ['iconfont'],
    }),
  ],
};

Vite

// vite.config.ts
import postcssRemoveFontFace from 'postcss-remove-font-face';

export default defineConfig({
  css: {
    postcss: {
      plugins: [postcssRemoveFontFace()],
    },
  },
});

Options

fontFamilyWhiteList

@font-face that match the font-family white list will not be removed.

This is usually useful for icon fonts, which may break the site if removed.

1.1.1

6 months ago

1.1.0

6 months ago

1.0.0

7 months ago