@fontsource-utils/scss
Version:
Fontsource SCSS Mixins
40 lines (25 loc) • 1.12 kB
Markdown
# Fontsource SCSS
This is a helper library to use [Fontsource](https://fontsource.org) with SCSS.
## Installation
```bash
npm install -utils/scss
```
## Import
Import the mixins and font metadata. This example uses the "Recursive" font family.
```scss
// Recommended: Use NodePackageImporter().
"pkg:@fontsource-utils/scss" as fontsource;
"pkg:@fontsource-variable/recursive" as recursive;
// Direct import: Adjust the path to `node_modules` if necessary.
"../node_modules/@fontsource-utils/src/mixins.scss" as fontsource;
"../node_modules/@fontsource-variable/recursive/scss/metadata.scss" as recursive;
```
- `NodePackageImporter()` reference: [`sass-lang.com`](https://sass-lang.com/documentation/at-rules/use/#pkg-ur-ls)
### Usage
Use the `faces` mixin to generate `-face` rules:
```scss
fontsource.faces($metadata: recursive.$metadata);
```
Learn more in the [Fontsource SCSS documentation](https://fontsource.org/docs/getting-started/sass-import).
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.