Skip to content

fix(problem): use CSS logical properties for RTL layout support - #1

Open
andrey-canon wants to merge 1 commit into
open-release/verawood.nelpfrom
and/FUTUREX-1839
Open

fix(problem): use CSS logical properties for RTL layout support#1
andrey-canon wants to merge 1 commit into
open-release/verawood.nelpfrom
and/FUTUREX-1839

Conversation

@andrey-canon

@andrey-canon andrey-canon commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes alignment and layout issues in Right-to-Left (RTL) languages for the ProblemBlock (xblocks_contrib.problem).

Previously, ProblemBlockDisplay.css used physical directional properties (margin-right, padding-left, left) that forced checkboxes, radio buttons, and labels to remain LTR-aligned even when rendering the platform in RTL languages (such as Arabic).

These physical properties have been replaced with CSS logical properties, allowing the browser to dynamically mirror alignments depending on the text direction (dir="ltr" or dir="rtl").

Changes Made

  • xblocks_contrib/problem/assets/static/css/ProblemBlockDisplay.css:
    • Replaced margin-right with margin-inline-end for choicetextgroup inputs.
    • Replaced padding-left with padding-inline-start for choicegroup labels.
    • Replaced left with inset-inline-start for radio buttons and checkboxes.

How to Test

  1. Checkout this branch

  2. Run npm install in the root directory of xblocks-core:
    npm install

  3. Build the assets:
    npm run build

  4. Go to a course page containing a problem block and verify the layout:

    • English (LTR): Verify that input choices, radio buttons, and labels retain their normal left-to-right alignment.
    • Arabic (RTL): Verify that input choices, radio buttons, and margins correctly mirror to the right side.

Before

EN

image

AR

image

After

EN

image

AR

image

NOTE

The platform contains a bug that doesn't allow to align correctly to see the full version please use this branch https://github.com/nelc/edx-platform/tree/and/FUTUREX-1805
image

Replace physical CSS properties (margin-right, padding-left, left) with
logical properties (margin-inline-end, padding-inline-start, inset-inline-start)
in ProblemBlockDisplay.css to fix choicegroup alignment issues in RTL locales.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant