Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yordis/postcss-google-font

PostCSS plugin for import Google fonts
https://github.com/yordis/postcss-google-font

font google-fonts postcss postcss-google-font

Last synced: 12 days ago
JSON representation

PostCSS plugin for import Google fonts

Awesome Lists containing this project

README

        

# PostCSS Google Font

[PostCSS] plugin for import Google fonts.

**Syntax:** `@google-font font-family styles [args]`

- **font-family**: The name of the font. **Compound family names** should
be wrapped out inside quotes or double quotes
- **styles**: The styles of the font. Use the comma for separated multiples
styles: `400,500,700italic`
- **args** (optional): The dislpay and subset of the font:
`display=swap,subset=latin|latin-ext`

```css
@google-font Lato 400 subset=latin;
@google-font Lato 400 display=swap,subset=latin|latin-ext;
```

```css
@import url(https://fonts.googleapis.com/css?family=Lato:400?subset=latin);
@import url(https://fonts.googleapis.com/css?family=Lato:400?display=swap&subset=latin,latin-ext);
```

## Usage

```js
postcss([ require('postcss-google-font') ])
```

See [PostCSS] docs for examples for your environment.

[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/yordis/postcss-google-font.svg
[ci]: https://travis-ci.org/yordis/postcss-google-font