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
  • #28238
Closed
Open
Issue created Feb 12, 2019 by Administrator@rootContributor

reboot styles breaks rtl text direction alignment

Created by: abhishekdev

Current behavior

Bootstrap reboot sets text-align:left on the body HTML element which in turn negates all effects of setting dir=rtl attribute OR direction CSS property on an element.

Test case behaviour with bootstrap (current working): https://jsbin.com/jeteqisema

Expected behavior

Setting text direction as right-to-left on elements should change the text direction and align it to the right (viz. the default browser behavior on all supported browsers).

Test case behavior without bootstrap (expected behavior): https://jsbin.com/riwafurose

Workaround

Set the value of CSS property text-align to initial for an element fixes on most modern browsers. On browsers which do not support initial, explicitly setting the value to right fixes the issue.

Test case behavior with bootstrap override (workaround): https://jsbin.com/zomezoyepu

Background

Issue #24807 (closed) tracks the rtl language support within bootstrap as an enhancement feature; however the current reboot behavior breaks the default semantics for CSS. Making bootstrap components work with rtl languages is an enhancement feature, however breaking the syntax and flow direction of plain text content seems to be a bug.

Additional cases to consider:

  • For user generated rich text content on a page using a right-to-left language, its not possible to predict/determine and set right alignment using CSS utility classes
  • Setting the unexpected text-align on body tag leads to CSS specificity wars and IE hacks.
  • The overall benefits of setting an explicit text-align:left on the body with CSS vs. setting it for individual components/controls is not apparent from the code comments. ref original commit. This makes it hard to figure if this behavior is intended for the current bootstrap version OR a new reset for the direction attribute be provided as part of the reboot code.

Environment

  • OS: all
  • Browser: all
Assignee
Assign to
Time tracking