Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reboot styles breaks rtl text direction alignment #28238

Closed
abhishekdev opened this issue Feb 12, 2019 · 0 comments · Fixed by #28989
Closed

reboot styles breaks rtl text direction alignment #28238

abhishekdev opened this issue Feb 12, 2019 · 0 comments · Fixed by #28989

Comments

@abhishekdev
Copy link

abhishekdev commented Feb 12, 2019

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 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
MartijnCuppens added a commit that referenced this issue Jul 4, 2019
This was causing issues for RTL, see #28238
MartijnCuppens added a commit that referenced this issue Jul 14, 2019
This was causing issues for RTL, see #28238
XhmikosR pushed a commit that referenced this issue Jul 15, 2019
This was causing issues for RTL, see #28238
@ffoodd ffoodd mentioned this issue Jun 8, 2020
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant