@gera2ld/rem
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@gera2ld/rem

NPM License Downloads

Adapt to different screens using rem.

Installation

$ yarn add @gera2ld/rem

Usage

import { scaleWidth } from '@gera2ld/rem';

scaleWidth();
// or
scaleWidth({
  mode: 'px',
  resize: false,
});

Options

  • mode

    • 'vw'

      Use vw as root unit if supported.

    • 'px'

      Use px as root unit.

    By default, if vw is supported, mode is set to 'vw', otherwise 'px'.

  • resize

    Whether the font size of root should be updated on resize. By default, resize is set to true if vw is not supported, otherwise false.

Readme

Keywords

none

Package Sidebar

Install

npm i @gera2ld/rem

Weekly Downloads

1

Version

0.1.2

License

ISC

Unpacked Size

8.07 kB

Total Files

5

Last publish

Collaborators

  • gera2ld