1.0.17 • Published 3 years ago

fontizer v1.0.17

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Fontizer

Small react helper to let users handle your fonts display

Demo

npm.io

How to use it

Install the package

yarn add fontizer

Prepare your CSS file, by adding these base values to your CSS :root element

--base-font-size: 16px;
--base-font-weight: 300;

Then load Fontizer on your page, it can take 3 props:

  • The position one that will position it ( in the corners ).
  • A callback function that returns the new values in an array [16, 300]
  • A variables props, which take an object with {size: '--new-variable-name', weight: '--new-variable-name'}

Note that if you decide to go with custom variable names, you MUST provide both size & weight variables

import { Fontizer } from "fontizer";

<Fontizer
  position="bl"
  callback={(value) => console.log(`values changed ${value}`)}
  variables={{ size: "--foo-bar-size", weight: "--foo-bar-weight" }}
/>;

Props

proptypevaluedefaultdescription
positionstring'bl' | 'br' | 'tl' | 'tr'blcorner coordinates to position your Fontizer button/panel
callbackFunctionany javascript functionnullPass a function using the callback returned value, happen on each updates
variablesobject{size: '--foo', weight: '--bar'}--base-font-size & --base-font-weightIf needed, you can override the default variables name.

A sprinkle of CSS?

override the styles

.fontizer-wrapper {
}
.fontizer-button {
}
.fontizer-icon {
}
.fontizer-panel {
}
1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago