Sets the reading direction of the document based on URL Query Parameter or toggle click. Stores the user's preference in local storage.
import Direction from '@nycopportunity/pttrn-scripts/src/direction/direction';
new Direction();Trigger
<button data-js="direction">Theme</button>Root Element
<html>Root Element
<html dir="rtl">Setting the URL Query Parameter to either /?dir=rtl or /?dir=ltr will also toggle the document's direction.