OfficeDev / office-ui-fabric-core

The front-end CSS framework for building experiences for Office and Microsoft 365.
https://developer.microsoft.com/en-us/fabric
Other
3.77k stars 465 forks source link

Directionality mixins don't work by default? #1223

Open sabintim opened 4 years ago

sabintim commented 4 years ago

Looks like the some of the LTR mixins in the following file don't work by default? (e.g., when there is no dir="ltr" attribute in the DOM explicitly).

Should LTR be treated as default if the attribute is absent? Is this by design?

https://github.com/OfficeDev/office-ui-fabric-core/blob/master/src/sass/mixins/_Directionality.Mixins.scss

E.g., ms-margin and ms-margin-left don't look consistent in the default behavior.

// This one will produce LTR margins by default even when dir=... is not present in the page
@mixin ms-margin($top, $right, $bottom, $left) {
  margin: $top $right $bottom $left;

  @include ms-RTL {
    margin: $top $left $bottom $right;
  }
}

// This one will not produce any margin if dir=... is not explicitly specified in page
@mixin ms-margin-left($distance) {
  @include ms-LTR {
    margin-left: $distance;
  }

  @include ms-RTL {
    margin-right: $distance;
  }
}