Skip to content

fix(rtl): use CSS logical properties for problem blocks and remove ha…#81

Merged
andrey-canon merged 1 commit into
open-release/teak.nelpfrom
and/fix-rtl-issues
Jul 16, 2026
Merged

fix(rtl): use CSS logical properties for problem blocks and remove ha…#81
andrey-canon merged 1 commit into
open-release/teak.nelpfrom
and/fix-rtl-issues

Conversation

@andrey-canon

Copy link
Copy Markdown
Collaborator

Description

This PR fixes styling and alignment issues when the platform is rendered in Right-to-Left (RTL) languages, specifically within the Problem Blocks (choice groups, radio buttons, and checkboxes).

Previously, the layout relied on physical CSS properties that forced elements to the left side regardless of the language direction. Additionally, a hardcoded LTR import in the SCSS architecture was overriding the dynamic RTL variables.

Changes Made

  • common/static/sass/_builtin-block-variables.scss:
    • Removed the @import 'vendor/bi-app/bi-app-ltr'; line. This prevents the LTR variables from overriding the $bi-app-left configurations when the platform is compiling the RTL stylesheet.
  • xmodule/static/css-builtin-blocks/ProblemBlockDisplay.css:
    • Modernized the layout by replacing physical directional properties with CSS logical properties.
    • Replaced margin-right with margin-inline-end.
    • Replaced padding-left with padding-inline-start.
    • Replaced left with inset-inline-start.

Impact

By delegating the alignment to the browser using logical properties, elements like radio buttons and checkboxes will now automatically mirror their position based on the dir="rtl" or dir="ltr" HTML attribute, fixing the UI without needing separate overriding stylesheets.

Before

EN

image

AR

image

After

EN

image

AR

image

…rdcoded LTR import

- Removed the explicit `@import 'vendor/bi-app/bi-app-ltr';` in `_builtin-block-variables.scss` that was overriding RTL configurations.
- Replaced physical CSS properties (`left`, `padding-left`, `margin-right`) with their logical equivalents (`inset-inline-start`, `padding-inline-start`, `margin-inline-end`) in `ProblemBlockDisplay.css` to natively support bidirectional layouts.
@andrey-canon
andrey-canon requested a review from johanseto July 16, 2026 15:11

@johanseto johanseto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This would be carried to upstream?

@andrey-canon
andrey-canon merged commit 53f1e30 into open-release/teak.nelp Jul 16, 2026
47 of 48 checks passed
@andrey-canon
andrey-canon temporarily deployed to open-release/teak.nelp July 16, 2026 20:44 — with GitHub Actions Inactive
@andrey-canon
andrey-canon had a problem deploying to open-release/teak.nelp July 16, 2026 20:44 — with GitHub Actions Failure
@andrey-canon
andrey-canon temporarily deployed to open-release/teak.nelp July 16, 2026 22:09 — with GitHub Actions Inactive
@andrey-canon
andrey-canon had a problem deploying to open-release/teak.nelp July 16, 2026 22:09 — with GitHub Actions Failure
@andrey-canon
andrey-canon temporarily deployed to open-release/teak.nelp July 17, 2026 17:47 — with GitHub Actions Inactive
@andrey-canon
andrey-canon had a problem deploying to open-release/teak.nelp July 17, 2026 17:47 — with GitHub Actions Failure
@andrey-canon
andrey-canon temporarily deployed to open-release/teak.nelp July 17, 2026 17:50 — with GitHub Actions Inactive
@andrey-canon
andrey-canon deployed to open-release/teak.nelp July 17, 2026 17:50 — with GitHub Actions Active
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 this pull request may close these issues.

2 participants