14.0.0 • Published 7 months ago

@material/rtl v14.0.0

Weekly downloads
106,219
License
MIT
Repository
github
Last release
7 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.

@everything-registry/sub-chunk-584test-checkboxtest-rsmdcnang-mdc-testmaterial-components-webmdsc-navigationpreact-material-componentspreact-material-components-mgr@authentic/mwc-chips@authentic/mwc-list@aurelia-material-components/corevue-material-design-components@infinitebrahmanuniverse/nolb-_mate@labstack/data-table@maicol07/mwa-card@maicol07/mwc-card@mhamrah/svelte-material-ui@material/toolbar@material/tabs@material/textfield@material/top-app-bar@material/touch-target@material/tooltip@material/menu-surface@material/list@material/menu@material/select@material/slider@material/snackbar@material/switch@material/tab@material/shape@material/banner@material/button@material/card@material/form-field@material/grid-list@material/icon-button@material/linear-progress@material/floating-label@material/focus-ring@material/notched-outline@material/ripple@material/dialog@material/dom@material/checkbox@material/drawer@material/chips@material/fab@material/elevation@material/data-table@material/circular-progress@emuanalytics/flow-rdf@mdcext/data-table@mdcext/date-picker@mdcext/input-dialog@mdcext/multiselect@mdcext/pagination@mdcext/treeview@react-universal-dialogs/android@pitaya-components/chips@o-rango/orango-material-design@smui-extra/badge@smui/chips@smui/form-field@smui/select@smui/textfield@detachhead/smui-chips@detachhead/smui-select@detachhead/smui-textfield@detachhead/smui-extra-badge@detachhead/smui-form-field@cpangular/ng-material-themeaurelia-material-uiaurelia-mdc-uiember-cli-mdc-rtl
14.0.0

3 years ago

13.0.0

3 years ago

12.0.0

3 years ago

11.0.0

4 years ago

10.0.0

4 years ago

9.0.0

4 years ago

8.0.0

4 years ago

7.0.0

5 years ago

6.0.0

5 years ago

5.1.0

5 years ago

5.0.0

5 years ago

4.0.0

5 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

6 years ago

0.42.0

6 years ago

0.40.1

6 years ago

0.39.1

6 years ago

0.39.0

6 years ago

0.36.0

7 years ago

0.35.0

7 years ago

0.34.0

7 years ago

0.33.0

7 years ago

0.30.0

7 years ago

0.29.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago