<script type="importmap">
{
"imports": {
"@w0s/writing-mode": "..."
}
}
</script>
<script type="module">
import WritingMode from '@w0s/writing-mode';
const writingMode = new WritingMode(document.querySelector('p'));
const value = writingMode.value; // 'vertical-rl'
const horizontal = writingMode.isHorizontal(); // false
const vertical = writingMode.isVertical(); // true
</script>
<p style="writing-mode: vertical-rl">text</p>
new WritingMode(
element: HTMLElement
)
element
[required]- Target element
get value(): 'horizontal-tb' | 'vertical-rl' | 'vertical-lr' | 'sideways-rl' | 'sideways-lr'
- Get the value of
writing-mode
isHorizontal(): boolean
- Whether the element is horizontal or not
isVertical(): boolean
- Whether the element is vertical or not