From 84db333d46bff81d3b2ae02a78fd85e931c896d4 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Thu, 30 Sep 2021 21:18:31 -0400 Subject: [PATCH] Add warning about RTL features being in preview Co-Authored-By: Adam Wathan <4323180+adamwathan@users.noreply.github.com> --- src/corePlugins.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/corePlugins.js b/src/corePlugins.js index 510893f66..79ff993a1 100644 --- a/src/corePlugins.js +++ b/src/corePlugins.js @@ -237,24 +237,30 @@ export default { directionVariants: ({ config, addVariant }) => { addVariant( 'ltr', - transformAllSelectors( - (selector) => - `[dir="ltr"] ${updateAllClasses( - selector, - (className) => `ltr${config('separator')}${className}` - )}` - ) + transformAllSelectors((selector) => { + log.warn('rtl-experimental', [ + 'The RTL features in Tailwind CSS are currently in preview.', + 'Preview features are not covered by semver, and may be improved in breaking ways at any time.', + ]) + return `[dir="ltr"] ${updateAllClasses( + selector, + (className) => `ltr${config('separator')}${className}` + )}` + }) ) addVariant( 'rtl', - transformAllSelectors( - (selector) => - `[dir="rtl"] ${updateAllClasses( - selector, - (className) => `rtl${config('separator')}${className}` - )}` - ) + transformAllSelectors((selector) => { + log.warn('rtl-experimental', [ + 'The RTL features in Tailwind CSS are currently in preview.', + 'Preview features are not covered by semver, and may be improved in breaking ways at any time.', + ]) + return `[dir="rtl"] ${updateAllClasses( + selector, + (className) => `rtl${config('separator')}${className}` + )}` + }) ) },