// scss-lint:disable ImportantRule

/// Global spacing unit
/// @access public
/// @group layout
/// @type number
$DBspacing-unit: 16px !default;

/// Global spacing sizes
/// @access public
/// @group layout
/// @type map
$DBspacing-sizes: (
  'xxs': .25,
  'xs': .5,
  's': 1,
  'm': 1.5,
  'l': 2,
  'xl': 4,
  'xxl': 6,
  'jumbo': 8
);

/// Global spacing edges
/// @access public
/// @group layout
/// @type map
$DBspacing-edges: (
  'top',
  'right',
  'bottom',
  'left',
  'vertical' ('top' 'bottom'),
  'horizontal' ('left' 'right')
);

.u-trim-margin {
    margin: 0 !important;
}

.u-trim-padding {
    padding: 0 !important;
}

@each $size, $scale in $DBspacing-sizes {

  .u-pad-#{$size} {
    padding: round($DBspacing-unit * $scale) !important;
  }

  .u-mar-#{$size} {
    margin: round($DBspacing-unit * $scale) !important;
  }

  @each $edge, $sub in $DBspacing-edges {
    // Padding
    .u-pad-#{$edge}-#{$size} {
      @if $sub {
        @each $subedge in $sub {
          padding-#{$subedge}: round($DBspacing-unit * $scale) !important;
        }
      } @else {
        padding-#{$edge}: round($DBspacing-unit * $scale) !important;
      }
    }

    // Margins
    .u-mar-#{$edge}-#{$size} {
      @if $sub {
        @each $subedge in $sub {
          margin-#{$subedge}: round($DBspacing-unit * $scale) !important;
        }
      } @else {
        margin-#{$edge}: round($DBspacing-unit * $scale) !important;
      }
    }
  }
}

// Floats
.u-l-fl,
%u-l-fl {
    float: left !important;
}

.u-l-fr,
%u-l-fr {
    float: right !important;
}

// Display types
.u-l-b {
    display: block !important;
}

.u-l-ib {
    display: inline-block !important;

    &--m {
        vertical-align: middle !important;
    }

    &--t {
        vertical-align: top !important;
    }

    &--b {
        vertical-align: bottom !important;
    }
}

.u-l-dn {
    display: none !important;
}
