# fluid-variable-font-events

> A function that helps to create fluid transitions with variable fonts

Latest version **1.0.1** (published 2019-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install fluid-variable-font-events
pnpm add fluid-variable-font-events
yarn add fluid-variable-font-events
bun add fluid-variable-font-events
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-09-13 |
| First published | 2019-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mandy Michael |
| Maintainers | mandymichael |
| Keywords | variable, fonts |

## Links

- npm: https://www.npmjs.com/package/fluid-variable-font-events
- Repository: https://github.com/mandymichael/fluid-axis-variation-events
- Homepage: https://github.com/mandymichael/fluid-axis-variation-events#readme
- Issues: https://github.com/mandymichael/fluid-axis-variation-events/issues
- npm.io page: https://npm.io/package/fluid-variable-font-events

## Recent versions

- 1.0.1 (latest) — 2019-09-13

## README

# Fluid Axis Variation Events
A simple function to use varible font axes with JavaScript events.

## Example usage

### Change font weight based on screen width

```
import {fluidAxisVariation} from 'fluid-variable-font-events'

// Set a range for the minimum & maximum font axis values
const minAxisValue = 200;
const maxAxisValue = 900;

// Set a range for the minimum & maximum event values
const minEventValue = 320;
const maxEventValue = 1440;

// Get the current event value
const currentEventValue = window.innerWidth;
var element = document.querySelector("p");

// Initial setting
fluidAxisVariation(minAxisValue, maxAxisValue, minEventValue, maxEventValue, window.innerWidth,"--weight", element);

// Event
window.addEventListener("resize", function(){
    fluidAxisVariation(minAxisValue, maxAxisValue, minEventValue, maxEventValue, window.innerWidth,"--weight", element);
}, false);
```

[Codepen Link](https://codepen.io/mandymichael/pen/oPoaEL)

## More examples
[variablefonts.dev](https://variablefonts.dev)
[Codepen Collection](https://codepen.io/collection/XqRLMb/)

---
_Source: https://npm.io/package/fluid-variable-font-events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
