14.0.0 • Published 5 months ago

@material/rtl v14.0.0

Weekly downloads
106,219
License
MIT
Repository
github
Last release
5 months ago

RTL

UIs for languages that are read from right-to-left (RTL), such as Arabic and Hebrew, should be mirrored to ensure content is easy to understand.

Design & API Documentation

Installation

npm install @material/rtl

Usage

Sass Mixins

mdc-rtl is the most flexible mixin, because it can work with multiple CSS properties. All other RTL mixins logic could be engineered by only using mdc-rtl, but we provide these mixins for convenience.

Both mdc-rtl-reflexive-property and mdc-rtl-reflexive-box work with one base box-model property, e.g. margin, border, padding. But mdc-rtl-reflexive-property is more flexible because it accepts different left and right values. mdc-rtl-reflexive-box assumes the left and right values are the same, and therefore that the box-model is symmetrical.

mdc-rtl-reflexive-position is the least flexible mixin. It only works with one horizontal position property, "left" or "right". It also assumes the left and right values are the same.

MixinDescription
mdc-rtl($root-selector)Creates a rule that is applied when the root element is within an RTL context
mdc-rtl-reflexive-box($base-property, $default-direction, $value, $root-selector)Applies the value to the #{$base-property}-#{$default-direction} property in a LTR context, and flips the direction in an RTL context. This mixin zeros out the original value in an RTL context.
mdc-rtl-reflexive-property($base-property, $left-value, $right-value, $root-selector)Emits rules that assign #{$base-property}-left to #{left-value} and #{base-property}-right to #{right-value} in a LTR context, and vice versa in a RTL context. Basically it flips values between a LTR and RTL context.
mdc-rtl-reflexive-position($position-property, $value, $root-selector)Applies the value to the specified position in a LTR context, and flips the direction in an RTL context. $position-property is a horizontal position, either "left" or "right".

A note about dir="rtl": mdc-rtl($root-selector) checks for [dir="rtl"] on the ancestor element. This works in most cases, it will sometimes lead to false negatives for more complex layouts, e.g.

<html dir="rtl">
  <!-- ... -->
  <div dir="ltr">
    <div class="mdc-foo">Styled incorrectly as RTL!</div>
  </div>
</html>

Unfortunately, we've found that this is the best we can do for now. In the future, selectors such as :dir will help us mitigate this.

@material/form-field@material/icon-button@material/list@material/linear-progress@material/floating-label@material/drawer@material/dialog@material/fab@material/elevation@material/data-table@material/dom@material/circular-progress@material/checkbox@material/button@material/card@material/chips@material/banner@material/menu@material/menu-surface@material/notched-outline@material/select@material/top-app-bar@material/touch-target@material/tooltip@material/ripple@material/slider@material/textfield@material/snackbar@material/switch@material/tab@material/shapematerial-components-web@everything-registry/sub-chunk-584ember-cli-mdc-rtl@aurelia-material-components/core@detachhead/smui-chips@detachhead/smui-select@detachhead/smui-textfield@detachhead/smui-extra-badge@detachhead/smui-form-fieldaurelia-material-uiaurelia-mdc-uimdsc-navigation@authentic/mwc-list@authentic/mwc-chips@angular/material@angular/material-experimentaltest-checkbox@infinitebrahmanuniverse/nolb-_mate@material/tabs@material/toolbar@maicol07/mwa-card@maicol07/mwc-card@material/focus-ring@material/grid-list@mdcext/data-table@mdcext/date-picker@mdcext/input-dialog@mdcext/multiselect@mdcext/pagination@mdcext/treeview@mhamrah/svelte-material-uinang-mdc-testtest-rsmdc@emuanalytics/flow-rdf@labstack/data-table@smui-extra/badge@smui/select@smui/chips@smui/form-field@smui/textfield@pitaya-components/chips@o-rango/orango-material-designvue-material-design-componentspreact-material-componentspreact-material-components-mgr@react-universal-dialogs/android
14.0.0

2 years ago

13.0.0

3 years ago

12.0.0

3 years ago

11.0.0

3 years ago

10.0.0

3 years ago

9.0.0

3 years ago

8.0.0

3 years ago

7.0.0

4 years ago

6.0.0

4 years ago

5.1.0

4 years ago

5.0.0

4 years ago

4.0.0

4 years ago

3.2.0

5 years ago

4.0.0-canary.1

5 years ago

4.0.0-canary.0

5 years ago

4.0.0-alpha.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

0.42.0

5 years ago

0.40.1

6 years ago

0.39.1

6 years ago

0.39.0

6 years ago

0.36.0

6 years ago

0.35.0

6 years ago

0.34.0

6 years ago

0.33.0

6 years ago

0.30.0

6 years ago

0.29.0

6 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago