{"version":3,"sources":["../../../../src/nhsuk/core/tools/_buttons.scss"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,uBAAuB;AACvB,uBAAuB;;AAEvB,GAAG;AACH,UAAU;AACV,EAAE;AACF,eAAe;AACf,GAAG;;AAEH,uCAAuC;AACvC,EAAE;AACF,6FAA6F;AAC7F,+EAA+E;AAC/E,iFAAiF;AACjF,iGAAiG;AACjG,uGAAuG;AACvG,wGAAwG;AACxG,6FAA6F;AAC7F,EAAE;;AAEF;;;;;;;;;EASE,gCAAgC;EAChC,+DAA+D;;EAE/D;;;;IAIE,0BAA0B;EAC5B;;EAEA;IACE,yBAAyB;;IAEzB;MACE,kBAAkB;IACpB;EACF;;EAEA;IACE;MACE,sCAAsC;IACxC,EAAE;MACA,gCAAgC;IAClC;EACF;;EAEA;;IAEE;MACE,uCAAuC;IACzC,EAAE;MACA,gCAAgC;IAClC;EACF;;EAEA,gCAAgC;EAChC;IACE;;;MAGE,qDAAqD;IACvD;EACF;;EAEA,4EAA4E;EAC5E,oEAAoE;EACpE;IACE;;MAEE,+DAA+D;IACjE;;IAEA;;;;;;MAME,mCAAmC;;MAEnC;QACE,0BAA0B;MAC5B;IACF;;IAEA,sEAAsE;IACtE,oEAAoE;IACpE;MACE,QAAQ;MACR,OAAO;MACP,wFAAwF;IAC1F;;IAEA,0DAA0D;IAC1D;;MAEE,gBAAgB;IAClB;EACF;;EAEA,wDAAwD;EACxD;IACE;;;;MAIE,iBAAiB;IACnB;;IAEA;;;;MAIE,4BAA4B;IAC9B;EACF;AACF","file":"_buttons.scss","sourcesContent":["@use \"sass:math\";\n@use \"../settings\" as *;\n@use \"./functions\" as *;\n\n////\n/// Buttons\n///\n/// @group tools\n////\n\n/// Button styling with colour overrides\n///\n/// @param {Colour} $button-colour [$nhsuk-secondary-button-colour] - Button background colour\n/// @param {Colour} $button-hover-colour [null] - Button hover background colour\n/// @param {Colour} $button-active-colour [null] - Button active background colour\n/// @param {Colour} $button-text-colour [$nhsuk-secondary-button-text-colour] - Button text colour\n/// @param {Colour} $button-shadow-colour [$nhsuk-secondary-button-shadow-colour] - Button shadow colour\n/// @param {Colour} $button-border-colour [null] - Button border colour (optional, e.g. secondary button)\n/// @param {Number} $button-border-radius [$nhsuk-button-border-radius] - Button border radius\n///\n\n@mixin nhsuk-button-style(\n  $button-colour: $nhsuk-secondary-button-colour,\n  $button-hover-colour: null,\n  $button-active-colour: null,\n  $button-text-colour: $nhsuk-secondary-button-text-colour,\n  $button-shadow-colour: $nhsuk-secondary-button-shadow-colour,\n  $button-border-colour: null,\n  $button-border-radius: $nhsuk-button-border-radius\n) {\n  background-color: $button-colour;\n  box-shadow: 0 $nhsuk-button-shadow-size 0 $button-shadow-colour;\n\n  &,\n  &:visited,\n  &:hover,\n  &:active {\n    color: $button-text-colour;\n  }\n\n  &[href]:not(:focus) .nhsuk-icon {\n    fill: $button-text-colour;\n\n    @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n      fill: currentcolor;\n    }\n  }\n\n  &:hover {\n    @if $button-hover-colour {\n      background-color: $button-hover-colour;\n    } @else {\n      background-color: $button-colour;\n    }\n  }\n\n  &:active,\n  &:active:focus {\n    @if $button-active-colour {\n      background-color: $button-active-colour;\n    } @else {\n      background-color: $button-colour;\n    }\n  }\n\n  // Override default border radius\n  @if $button-border-radius != $nhsuk-button-border-radius {\n    &,\n    &::before,\n    &::after {\n      border-radius: nhsuk-px-to-rem($button-border-radius);\n    }\n  }\n\n  // Handle shadow on both the button and the pseudo element. The button shadow\n  // remains in place to prevent any pixel gaps due to browser rounding\n  @if $button-border-colour {\n    &,\n    &::after {\n      box-shadow: 0 $nhsuk-button-shadow-size 0 $button-shadow-colour;\n    }\n\n    &:active,\n    &:active:focus,\n    // Set border on click area for default and hover states which allows the\n    // border to render underneath the shadow and hide pixel artifacts, but\n    // ensuring the active \"pressed\" and focus states have priority\n    &:not(:focus):not(:active)::before {\n      border-color: $button-border-colour;\n\n      @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n        border-color: ButtonBorder;\n      }\n    }\n\n    // Inset the pseudo element shadow away from the edges, to restore lost\n    // border radius (and its shadow) previously hidden by the 2px border\n    &:not(:focus)::after {\n      right: 0;\n      left: 0;\n      border-radius: nhsuk-px-to-rem($button-border-radius - $nhsuk-border-width-form-element);\n    }\n\n    // Remove the pseudo element shadow when focused or pressed\n    &:focus::after,\n    &:active::after {\n      box-shadow: none;\n    }\n  }\n\n  // Override high-contrast button colours back to defaults\n  @media screen and (forced-colors: active), (-ms-high-contrast: active) {\n    &,\n    &:visited,\n    &:hover,\n    &:active {\n      color: ButtonText;\n    }\n\n    &,\n    &:hover,\n    &:active,\n    &:active:focus {\n      background-color: ButtonFace;\n    }\n  }\n}\n"]}
