Body element
Browser name in lowercase. Popular results:
Document
Device pixel ratio
Current viewport height
HTML element
Is viewport in landscape mode
LG breakpoint is active
If the page is loaded
Lower device pixel ratio (1 for desktop and maximum 2 for mobile devices)
MD breakpoint is active
Is mobile device
Add an event on page load.
Adds viewport callbacks.
Adds a callback and returns a destructor to remove it.
Event name to associate the callback with.
Function to execute on the event.
Optional callback settings (e.g., timeout, one-time).
A function to remove the callback.
vevet.onViewport('width', () => console.log('width changed'));
vevet.onViewport('height', () => console.log('height changed'));
vevet.onViewport('both', () => console.log('both width and height changed'));
vevet.onViewport('width_', () => console.log('only width changed'));
vevet.onViewport('height_', () => console.log('only height changed'));
const destruct = vevet.onViewport('any', () => console.log('any change'));
// cancel the event
destruct();
OS name in lowercase. Popular results:
Is phone device
Is viewport in portrait mode
Prefix used by Vevet for class names.
Application properties
Root font-size
in pixels (1rem
to pixels)
Current viewport small height
Used to prevent layout shifts on some browsers such as In-App Safari.
SM breakpoint is active
Current viewport small height divided by 100 (svh).
Used to prevent layout shifts on some browsers such as In-App Safari.
Is tablet device
Current Vevet version
Current viewport height divided by 100
List of viewport callbacks
Current viewport width divided by 100
Current viewport width
Vevet Core