https://github.com/swissgrc/postcss-remove-font-face-format
📦 PostCSS plugin to remove font faces formats
https://github.com/swissgrc/postcss-remove-font-face-format
font-face hacktoberfest plugin postcss
Last synced: 4 months ago
JSON representation
📦 PostCSS plugin to remove font faces formats
- Host: GitHub
- URL: https://github.com/swissgrc/postcss-remove-font-face-format
- Owner: swissgrc
- License: mit
- Created: 2022-02-25T07:11:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T09:20:54.000Z (4 months ago)
- Last Synced: 2025-03-24T10:29:36.298Z (4 months ago)
- Topics: font-face, hacktoberfest, plugin, postcss
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/postcss-remove-font-face-format
- Size: 409 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# postcss-remove-font-face-format
[PostCSS] plugin to remove font faces by format.
[PostCSS]: https://github.com/postcss/postcss
```css
.foo {
/* Input example */
@font-face {
font-family: "Open Sans";
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
}
``````css
.foo {
/* Output example */
@font-face {
font-family: "Open Sans";
src: url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
}
```## Usage
**Step 1:** Install plugin:
```sh
npm install --save-dev postcss postcss-remove-font-face-format
```**Step 2:** Check your project for existing PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.**Step 3:** Add the plugin to plugins list:
```diff
module.exports = {
plugins: [
+ require('postcss-remove-font-face-format'),
require('autoprefixer')
]
}
```[official docs]: https://github.com/postcss/postcss#usage