# postcss-zoom-font-size

> PostCSS plugin zoom you font-size in new CSS file.

Latest version **0.1.3** (published 2016-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-zoom-font-size
pnpm add postcss-zoom-font-size
yarn add postcss-zoom-font-size
bun add postcss-zoom-font-size
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2016-05-26 |
| First published | 2016-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Talgat Uspanov |
| Maintainers | talgautb |
| Keywords | postcss, css, postcss-plugin, font-size, a11y |

## Links

- npm: https://www.npmjs.com/package/postcss-zoom-font-size
- Repository: https://github.com/talgautb/postcss-zoom-font-size
- Issues: https://github.com/talgautb/postcss-zoom-font-size/issues
- npm.io page: https://npm.io/package/postcss-zoom-font-size

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^5.0.21

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2016-05-26
- 0.1.2 — 2016-05-26
- 0.1.1 — 2016-05-26
- 0.1.0 — 2016-05-26

## README

# PostCSS Zoom Font-Size [![Build Status][ci-img]][ci]

[PostCSS] plugin zoom you font-size in new CSS file (default 120%).

## Why?

Because of accessibility (a11y). Best way to use relative values for font-size but if you are not, use my plugin to add function of scale font-size on site.

Other a11y PostCSS plugins:

- [PostCSS High Contrast](https://github.com/admdh/postcss-high-contrast);

[PostCSS]: https://github.com/postcss/postcss
[ci-img]:  https://travis-ci.org/talgautb/postcss-zoom-font-size.svg
[ci]:      https://travis-ci.org/talgautb/postcss-zoom-font-size

## Example

```css
.bar {
    color: #000;
    font-size: inherit;
}

.foo {
    font-size: 10px;
}
```

```css
.foo {
    font-size: 12px;
}
```

## Usage

```js
postcss([ require('postcss-zoom-font-size')({ zoom: 120 }) ])
```

See [PostCSS] docs for examples for your environment.

### Appending to webpage

Using this plugin it's better to generate new version of css file with scale font-size. Than it is very easy to add/append new version css to a webpage using JavaScript.
JQuery example:

```
function appendZoomFsCSS(){
    var fs = '<link rel="stylesheet" href="/path/to/css/font-size.css" id="fscss"/>';

    if (!$('#highContrastCss').length){
        $('head').append(fs);
    } else {
        $('#fscss').remove();
    }
}

$('.js_zoom-fs').click(loadHighContrastCSS);
    appendZoomFsCSS();
}
```

## Options

#### zoom

Type: `number` (default: 120)

Use nubmer in percent to scale you font-size.

## License

MIT © [Talgat uspanov](http://www.gtalk.kz)

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