1.0.5 • Published 3 years ago
@nmsp/ui-components v1.0.5
@nmsp/ui-utilities
Overview
@nmsp/ui-utilities
contains utilities for frontend design/UI.
Installation
npm install @nmsp/ui-utilities
Usage
Each utility function can be imported as a named import. For example,
import { useSetScreenCSSVariables } from '@nmsp/ui-utilities'
.
Available Functions
useSetScreenCSSVariables
Sets CSS variables --inner-height
and --inner-width
to the window
innerHeight
and
innerWidth
values as a px
value. This hook can simply be included in the app and applies
listeners to the window resize event and updates the CSS value accordingly.
Why?
The CSS vh
unit can't be trusted
Syntax
useSetScreenCSSVariables()
Parameters
none |