Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 467 Bytes

README.md

File metadata and controls

32 lines (23 loc) · 467 Bytes

use-viewport-height

Install

npm install use-viewport-height
// or
yarn add use-viewport-height

Usage

// 1. Import the hooks
import useViewportHeight from 'use-viewport-height'

const App = () => {

  // 2. Add it to your app
  useViewportHeight()

  return (...)
}

and anywhere in your css file you can access the viewport height with: var(--tenka-viewport-height)

.my-div {
  height: var(--tenka-viewport-height);
}