@use "../../core/settings" as *;
@use "../../core/tools" as *;

////
/// Label component
///
/// @group components/label
////

@include nhsuk-exports("nhsuk/components/label") {
  .nhsuk-label {
    display: block;
    margin-bottom: nhsuk-spacing(1);

    @include nhsuk-font($size: 19);
  }

  // Modifiers that make labels look more like their equivalent headings
  .nhsuk-label--xl,
  .nhsuk-label--l,
  .nhsuk-label--m {
    margin-bottom: nhsuk-spacing(3);
    @include nhsuk-font-weight-bold;
  }

  .nhsuk-label--xl {
    @include nhsuk-font-size($size: 48);
  }

  .nhsuk-label--l {
    @include nhsuk-font-size($size: 36);
  }

  .nhsuk-label--m {
    @include nhsuk-font-size($size: 26);
  }

  .nhsuk-label--s {
    @include nhsuk-font-weight-bold;
  }

  // When the label is nested inside a heading, override the heading so that it
  // does not have a margin. Effectively we want to be able to treat the heading
  // as if it is not there.
  //
  // This breaks BEM conventions because it exists as a parent of the 'block',
  // so we can't really consider an element.
  .nhsuk-label-wrapper {
    margin: 0;
  }
}
