Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #22137
Closed
Open
Issue created Mar 08, 2017 by Administrator@rootContributor

Input group RTL support temporary fix

Created by: adelivuk-zz

I know that RTL support will come later - from @cvrebert's comment:

There isn't one, but don't worry, given the number of times folks have asked for RTL, we won't soon forget about it. But we're not going to delay v4.0.0 for this. RTL will probably land in a later minor release (e.g. v4.2.0).

However, I had an task to make bootstrap RTL and had some issue with input groups - I just added dir="rtl" to the parent element and the result is:

y

Where you can see that the styles are messed up.

So, I've created a fix - it's not something special but it does the work. The CSS snippet:

[dir="rtl"] .input-group-addon:not(:last-child){
  border-right: 1px solid rgba(0,0,0,.15);
  border-left: 0;
}

[dir="rtl"] .input-group .form-control:not(:last-child),
[dir="rtl"] .input-group-addon:not(:last-child),
[dir="rtl"] .input-group-btn:not(:first-child)>.btn-group:not(:last-child)>.btn,
[dir="rtl"] .input-group-btn:not(:first-child)>.btn:not(:last-child):not(.dropdown-toggle),
[dir="rtl"] .input-group-btn:not(:last-child)>.btn,
[dir="rtl"] .input-group-btn:not(:last-child)>.btn-group>.btn,
[dir="rtl"] .input-group-btn:not(:last-child)>.dropdown-toggle{
  border-bottom-right-radius: .25rem;
  border-top-right-radius: .25rem;
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
}

[dir="rtl"] .input-group .form-control:not(:first-child),
[dir="rtl"] .input-group-addon:not(:first-child),
[dir="rtl"] .input-group-btn:not(:first-child)>.btn,
[dir="rtl"] .input-group-btn:not(:first-child)>.btn-group>.btn,
[dir="rtl"] .input-group-btn:not(:first-child)>.dropdown-toggle,
[dir="rtl"] .input-group-btn:not(:last-child)>.btn-group:not(:first-child)>.btn,
[dir="rtl"] .input-group-btn:not(:last-child)>.btn:not(:first-child){
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: .25rem;
  border-top-left-radius: .25rem;
}

[dir="rtl"] .form-control + .input-group-addon:not(:first-child){
  border-left: 1px solid rgba(0,0,0,.15);
  border-right: 0;
}

[dir="rtl"] .input-group .form-control:not(:first-child):not(:last-child),
[dir="rtl"] .input-group .input-group-addon:not(:first-child):not(:last-child){
  border-radius: 0;
}

Preview:

a

Here's the full JSBin

Hope that it'll help someone with the same issue.

P.S. Love the new bootstrap - flexbox rules :) cheers

Assignee
Assign to
Time tracking