@sb-m/ui-utilities
v1.1.4
Published
Design/UI utilities used for sb-m
Downloads
23
Maintainers
Readme
@sb-m/ui-utilities
Overview
@sb-m/ui-utilities
contains utilities for frontend design/UI.
Installation
npm install @sb-m/ui-utilities
Usage
Each utility function can be imported as a named import. For example,
import { useSetScreenCSSVariables } from '@sb-m/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 |