Skip to content

Latest commit

 

History

History

direction

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Direction

Sets the reading direction of the document based on URL Query Parameter or toggle click. Stores the user's preference in local storage.

Usage

JavaScript

import Direction from '@nycopportunity/pttrn-scripts/src/direction/direction';

new Direction();

Markup

Default State

Trigger

<button data-js="direction">Theme</button>

Root Element

<html>

Toggled State

Root Element

<html dir="rtl">

Query Parameter

Setting the URL Query Parameter to either /?dir=rtl or /?dir=ltr will also toggle the document's direction.