You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guide/styling.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,8 @@ This list of properties can be set in CSS or through the style property of each
226
226
| `border-radius` | `borderRadius` | Sets a border radius to the matched view’s. |
227
227
| `box-shadow` | `boxShadow` | Sets a box shadow to the matched view's. |
228
228
| `clip-path` | `clipPath` | Sets the clip-path. Supported shapes are circle, ellipse, rect and polygon. You can define your own shape using [clippy](http://bennettfeely.com/clippy/) |
229
-
| `color` | `color` | Sets a solid-color value to the matched view’s foreground. |
229
+
| `color` | `color` | Sets a solid-color value to the matched view’s foreground.
230
+
| `direction` | `direction` | Sets the direction of text, table and grid columns, and horizontal overflow. Use rtl for languages written from right to left (like Hebrew or Arabic), and ltr for those written from left to right (like English and most other languages). |
230
231
| `font` | `font` | Sets the font properties (this includes `font-family`, `font-size`, `font-style` and `font-weight`) of the matched view. |
231
232
| `font-family` | `fontFamily` | Sets the font family of the matched view. |
232
233
| `font-size` | `fontSize` | Sets the font size of the matched view (only supports device-independent units). |
@@ -259,6 +260,39 @@ This list of properties can be set in CSS or through the style property of each
259
260
| `width` | `width` | Sets the view width. |
260
261
| `z-index` | `zIndex` | Sets the z-index. (On Android API Level 21 and above.) |
261
262
263
+
## Layout direction (LTR / RTL)
264
+
265
+
NativeScript now supports an **inherited CSS `direction` property** to force the layout direction of views to either left-to-right (`ltr`) or right-to-left (`rtl`).
266
+
267
+
```css
268
+
/* Apply RTL to the entire app */
269
+
.ns-root {
270
+
direction: rtl;
271
+
}
272
+
```
273
+
274
+
What this does:
275
+
276
+
- tells NativeScript to use the **platform’s native direction APIs** so you get the OS-level behavior for RTL,
277
+
- makes navigation transitions direction-aware (slide, flip, etc.),
278
+
- makes default label/text alignment respect the direction,
279
+
- enables direction-aware layout for FlexboxLayout on iOS,
280
+
- aligns horizontal scroll views to the end in RTL,
281
+
- and allows using `start` / `end` values for `horizontalAlignment` to align relative to the current direction.
0 commit comments