@use '@nice-digital/nds-core/scss/typography';

////
/// @group helpers
////

$output-text-classes: true !default;

@if $output-text-classes {
  // ## Alignment

  /// Justified text alignment
  /// @since 0.1.0
  .text-justify {
    text-align: justify !important;
  }

  /// Stop text from wrapping
  /// @since 0.1.0
  .text-nowrap {
    white-space: nowrap !important;
  }

  /// Align text left
  /// @since 0.1.0
  .text-left {
    text-align: left !important;
  }

  /// Align text right
  /// @since 0.1.0
  .text-center {
    text-align: center !important;
  }

  /// Align text right
  /// @since 0.1.0
  .text-right {
    max-width: 100%; // Because of max character width on paragraphs
    text-align: right !important;
  }

  // TODO: Responsive text alignment

  // ## Transformation

  /// Lowercase text
  /// @since 0.1.0
  .text-lowercase {
    text-transform: lowercase !important;
  }

  /// Uppercase text
  /// @since 0.1.0
  .text-uppercase {
    text-transform: uppercase !important;
  }

  /// Capitalized text
  /// @since 0.0.1
  .text-capitalize {
    text-transform: capitalize !important;
  }

  // ## Font weight/italics

  /// Normal font weight
  /// @since 0.1.0
  .font-weight-normal {
    font-weight: normal;
  }

  /// Bold font weight
  /// @since 0.1.0
  .font-weight-bold {
    font-weight: bold;
  }

  /// Italic font style
  /// @since 0.1.0
  .font-italic {
    font-style: italic;
  }

  /// Applies the sans-serif font stack
  /// @since 3.0.0
  .font-family-sans {
    font-family: typography.get-font-family(sans);
  }

  /// Applies the serif font stack
  /// @since 3.0.0
  .font-family-serif {
    font-family: typography.get-font-family(serif);
  }

  /// Applies the mono font stack
  /// @since 3.0.0
  .font-family-mono {
    font-family: typography.get-font-family(mono);
  }

  /// Quick left float
  /// @since 0.1.0
  .left {
    float: left;
  }

  /// Quick right float
  /// @since 0.1.0
  .right {
    float: right;
  }

  /// Set and element to display as block and align
  /// centrally via auto left/right margins
  /// @since 0.1.0
  .center-block {
    @include typography.center-block;
  }
}
