// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.

//
// Office UI Fabric
// --------------------------------------------------
// Utility classes and mixins used throughout Fabric.

@import "Fabric.Mixins";

// The best box is a border box.
@mixin ms-u-borderBox {
  box-sizing: border-box;
}

// For setting the border base width
@mixin ms-u-borderBase {
  border: 1px solid;
}

// Ensures the block expands to the full height to enclose its floated childen.

@mixin ms-u-clearfix {
  *zoom: 1;
  &:before,
  &:after {
    display: table;
    content: "";
    line-height: 0;
  }
  &:after {
    clear: both;
  }
}

// Basic border-box, margin, and padding reset.
@mixin ms-u-normalize {
  @include ms-u-borderBox;
  @include resetMargins;
  @include resetPadding;
  @include resetBoxShadow;
}

// To set various text alignment styles 
// @param [variable list] $alignments
@mixin ms-u-textAlign($alignments...) {
  @each $align in $alignments {
    $alignStr: inspect($align);
    .ms-u-textAlign#{to-upper-case(str-slice($alignStr, 1, 1)) + str-slice($alignStr, 2)} {
      text-align: $align;
    }
  }
}

// To hide content while still making it readable by screen readers (Accessibility)
@mixin ms-u-screenReaderOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

// To add truncation with ellipsis
@mixin ms-u-textTruncate {
	overflow: hidden; 
	text-overflow: ellipsis; 
	white-space: nowrap; 
	word-wrap: normal; // Fix for IE 8/9 in case 'word-wrap: break-word' is set on parent nodes
}

// To disable text wrapping
@mixin ms-u-noWrap {
	white-space: nowrap; 
}