Skip to content

Instantly share code, notes, and snippets.

@cossssmin
Forked from patrikengborg/tailwind-rtl.js
Created October 4, 2018 15:49
Show Gist options
  • Save cossssmin/df90e1c5f0243f0486fbeab20534ab3a to your computer and use it in GitHub Desktop.
Save cossssmin/df90e1c5f0243f0486fbeab20534ab3a to your computer and use it in GitHub Desktop.
Function for Tailwind to add a custom variant plugin for RTL sites.
function ({ addVariant }) {
addVariant('rtl', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `[dir="rtl"] .rtl${separator}${className}`
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment