Skip to content

RTL

@vuepress/plugin-rtl

This plugin sets text direction to RTL on configured locales.

Usage

npm i -D @vuepress/plugin-rtl@next
.vuepress/config.ts
import { rtlPlugin } from '@vuepress/plugin-rtl'

export default {
  plugins: [
    rtlPlugin({
      // options
      locales: ['/ar/'],
    }),
  ],
}

Demo

Options

localesstring[]
Default['/']

RTL locale paths to enable RTL layout.

selectorSelectorOptions
Default{ 'html': { dir: 'rtl' } }

Selector configuration to enable RTL layout. The default settings mean that the dir attribute of the html element will be set to rtl in RTL locales.

Its type is:

interface SelectorOptions {
  [cssSelector: string]: {
    [attr: string]: string
  }
}

MIT Licensed