Skip to content

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

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

fix(rtl): use CSS logical properties for problem blocks and remove ha…#92
andrey-canon wants to merge 1 commit into
open-release/verawood.nelpfrom
and/FUTUREX-1805

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 within the Problem Blocks (choice groups, radio buttons, and checkboxes) for the Verawood release.

Previously, the layout relied on physical CSS properties that forced elements to the left side regardless of the language direction.

Changes Made

  • 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.

How to Test

  1. Checkout This branch

  2. Set the following setting to False: USE_EXTRACTED_PROBLEM_BLOCK = False

  3. Compile assets: npm run compile-sass -- --skip-themes

Before

EN

image

AR

image

After

EN

image

AR

image

Issue #1805
Migration pr of #81

…rdcoded LTR import (#81)

- 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.
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.

2 participants