-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve support for right-to-left languages (#3073)
Implements DHIS2-16778 Key features * Use logical CSS properties instead of physical properties throughout the project (done automatically with a tool) * Update the cli-style to a version that supports checking logical properties Description This PR implements better support for right-to-left languages in the app, by leveraging the use of logical CSS properties that are independent of language direction, rather than physical properties (i.e. *-start instead of -left and *-end instead *-right). Logical properties are widely supported now and they should become the default way for layout going-forward to ensure that we support RTL languages without extra development burden (will be enforced by d2 style). The better support for RTL builds on top of previous work done in the platform, namely: * changing the UI library to support RTL: feat: rtl support for components [LIBS-525] ui#1448 * introducing an opt-in option in d2.config that allows apps to declare they're ready to support RT. The platform changes also takes care of setting the correct direction and language for the header among other things: feat: add configurable dir for language directions to app adapter [DHIS2-16480] app-platform#825 * updates to cli-style to enforce and apply rules for using logical CSS properties: feat: add stylelint cli-style#464 --------- Co-authored-by: Martin <martin@moid.se> Co-authored-by: @dhis2-bot <apps@dhis2.org> Co-authored-by: Jen Jones Arnesen <jennifer@dhis2.org>
- Loading branch information
1 parent
f88382b
commit 777b36d
Showing
59 changed files
with
837 additions
and
516 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: [config.stylelint], | ||
rules: { | ||
'csstools/use-logical': [ | ||
true, | ||
{ | ||
severity: 'error', | ||
}, | ||
], | ||
}, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ const config = { | |
|
||
minDHIS2Version: '2.40', | ||
|
||
direction: 'auto', | ||
|
||
pwa: { | ||
enabled: true, | ||
caching: { | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
.tabs { | ||
width: 200px; | ||
inline-size: 200px; | ||
position: absolute; | ||
top: 136px; /* modal title + horizontal tab bar height */ | ||
bottom: 84px; /* modal actions section height */ | ||
inset-block: 136px 84px; /* modal title + horizontal tab bar height */ /* modal actions section height */ | ||
z-index: 1; | ||
} | ||
|
||
.content { | ||
margin-left: 200px; | ||
margin-inline-start: 200px; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.panel { | ||
width: 380px; | ||
inline-size: 380px; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/components/DimensionsPanel/Dialogs/styles/DialogManager.module.css
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.tabs { | ||
padding-bottom: var(--spacers-dp16); | ||
padding-block-end: var(--spacers-dp16); | ||
} |
This file contains 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
9 changes: 6 additions & 3 deletions
9
src/components/DimensionsPanel/styles/DndDimensionsPanel.module.css
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
.container { | ||
height: 100%; | ||
block-size: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
background-color: var(--colors-grey100); | ||
border-right: 1px solid var(--colors-grey400); | ||
border-inline-end: 1px solid var(--colors-grey400); | ||
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.03); | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
|
||
.filter { | ||
padding: var(--spacers-dp8) var(--spacers-dp8) 0 var(--spacers-dp8); | ||
padding-block-start: var(--spacers-dp8); | ||
padding-block-end: 0; | ||
padding-inline-start: var(--spacers-dp8); | ||
padding-inline-end: var(--spacers-dp8); | ||
background: var(--colors-white); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.container { | ||
margin-top: var(--spacers-dp12); | ||
margin-bottom: var(--spacers-dp16); | ||
margin-block-start: var(--spacers-dp12); | ||
margin-block-end: var(--spacers-dp16); | ||
} |
This file contains 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
4 changes: 2 additions & 2 deletions
4
src/components/Layout/DefaultLayout/styles/DefaultAxis.module.css
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,6 @@ export const styles = { | |
}, | ||
label: { | ||
whiteSpace: 'normal', | ||
marginLeft: '6px', | ||
marginInlineStart: '6px', | ||
}, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.container { | ||
position: fixed; | ||
bottom: 0; | ||
left: 50%; | ||
inset-block-end: 0; | ||
inset-inline-start: 50%; | ||
transform: translateX(-50%); | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.