<p dir="auto">I have a tab component inside a modal, when i change the tab modal 'show' event trigger.</p>
<p dir="auto"><a href="http://jsfiddle.net/photonx/7zP8f/1/" rel="nofollow">http://jsfiddle.net/photonx/7zP8f/1/</a></p>
<p dir="auto">I have built this issue to discuss the approach for supporting RTL in the upcoming 3.1 version. Although it's too early for implementation code and pull requests, choosing the right approach now helps in the planning, and directing the efforts towards a specific goal (as many people have already volunteered for the task).</p>
<p dir="auto">I think the biggest issue is the lack of a standard, or best practices for adding RTL support for themes and pages. First, I want to review some of the current practices for RTL support in different parts of the web.</p>
<ul dir="auto">
<li>WordPress: uses RTL overrides, in a single seperate file named rtl.css, auto-loaded by WordPress in right-to-left pages. <a href="http://codex.wordpress.org/Right-to-Left_Language_Support" rel="nofollow">explained here</a></li>
<li>Drupal 7: uses RTL overrides, in a separate file with -rtl.css prefix for every css file loaded by themes, etc. again, auto-loaded in right-to-left pages. <a href="https://drupal.org/node/222782" rel="nofollow">explained here</a></li>
<li>Drupal 8: favors RTL overrides prefixed by <code class="notranslate">[dir="rtl"]</code>, alongside the base css (no separate files). explained <a href="https://drupal.org/node/2032405" rel="nofollow">here</a>; also, see the <a href="https://drupal.org/node/2015789" rel="nofollow">related discussion</a></li>
<li>RTL-This (a website dedicated to turning everything RTL): Has an article comparing different ways to add RTL to css <a href="http://rtl-this.com/tutorial/3-different-ways-rtl-your-css" rel="nofollow">here</a>.</li>
<li>Another article by a css-expert (Jens O. Meiert): ... Indicate directionality by the dir attribute on the html element ... Avoid a separate RTL style sheet; find all declarations that specify anything specific to the left or right ... customize those declarations, and use some hook to apply them—like e.g. setting id="rtl" on the body element (well, you really want to use html[dir="rtl"]). article <a href="http://meiert.com/en/blog/20081211/5-rtl-tips/" rel="nofollow">here</a>.</li>
<li>Another popular approach is to prefix all RTL rules with a .rtl class (and possibly .ltr for base rules, to prevent overrides). per <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="4174374" data-permission-text="Title is private" data-url="https://github.com/twbs/bootstrap/issues/3133" data-hovercard-type="issue" data-hovercard-url="/twbs/bootstrap/issues/3133/hovercard" href="https://github.com/twbs/bootstrap/issues/3133">#3133</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9581383" data-permission-text="Title is private" data-url="https://github.com/twbs/bootstrap/issues/6423" data-hovercard-type="pull_request" data-hovercard-url="/twbs/bootstrap/pull/6423/hovercard" href="https://github.com/twbs/bootstrap/pull/6423">#6423</a>, and the <a href="https://github.com/danielkatz/less-bidi">less-bidi</a> model.</li>
</ul>
<p dir="auto">I'd suggest using an approach than could satisfy these different requirements by simple customizations.</p>
<ol dir="auto">
<li>I suggest keeping the RTL rules in a separate css file. Clearly, merging them into a single stylesheet (when required) would be a single copy-paste at the end of the base css.</li>
<li>I suggest using overrides (vs mixins, or automated tools) in a separate .less file. Then, adding any combination of prefixes, or <code class="notranslate">[dir=</code> rules is as easy as a few lines of .less code. example:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[dir=&quot;rtl&quot;] {
  @include &quot;bootstrap-rtl.less&quot;
}"><pre class="notranslate"><code class="notranslate">[dir="rtl"] {
  @include "bootstrap-rtl.less"
}
</code></pre></div>
<p dir="auto">or</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=".ltr {
  @include &quot;bootstrap.less&quot;;
}

.rtl {
  @include &quot;bootstrap-rtl.less&quot;;
}"><pre class="notranslate"><code class="notranslate">.ltr {
  @include "bootstrap.less";
}

.rtl {
  @include "bootstrap-rtl.less";
}
</code></pre></div>