fix(problem): use CSS logical properties for RTL layout support - #1
Open
andrey-canon wants to merge 1 commit into
Open
fix(problem): use CSS logical properties for RTL layout support#1andrey-canon wants to merge 1 commit into
andrey-canon wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes alignment and layout issues in Right-to-Left (RTL) languages for the
ProblemBlock(xblocks_contrib.problem).Previously,
ProblemBlockDisplay.cssused 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"ordir="rtl").Changes Made
xblocks_contrib/problem/assets/static/css/ProblemBlockDisplay.css:margin-rightwithmargin-inline-endfor choicetextgroup inputs.padding-leftwithpadding-inline-startfor choicegroup labels.leftwithinset-inline-startfor radio buttons and checkboxes.How to Test
Checkout this branch
Run
npm installin the root directory ofxblocks-core:npm installBuild the assets:
npm run buildGo to a course page containing a problem block and verify the layout:
Before
EN
AR
After
EN
AR
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
