{"version":3,"sources":["../../../../src/nhsuk/core/settings/_warnings.scss"],"names":[],"mappings":"AAAA,gBAAgB;;AAEhB,GAAG;AACH,WAAW;AACX,EAAE;AACF,2BAA2B;AAC3B,GAAG;;AAEH,0BAA0B;AAC1B,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,qEAAqE;AACrE,8EAA8E;AAC9E,4EAA4E;AAC5E,EAAE;AACF,gFAAgF;AAChF,uEAAuE;AACvE,EAAE;AACF,gBAAgB;AAChB,wBAAwB;AACxB,wEAAwE;AACxE,sDAAsD;AACtD,kCAAkC;AAClC,aAAa;AACb,OAAO;AACP,EAAE;AACF,6GAA6G;;AAE7G,uCAAuC;;AAEvC,WAAW;AACX,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,sDAAsD;AACtD,EAAE;AACF,oFAAoF;AACpF,2EAA2E;AAC3E,4EAA4E;AAC5E,iEAAiE;AACjE,8EAA8E;AAC9E,4BAA4B;AAC5B,EAAE;AACF,oFAAoF;AACpF,iEAAiE;AACjE,qEAAqE;AACrE,yEAAyE;AACzE,kCAAkC;AAClC,EAAE;AACF,6GAA6G;;AAE7G;EACE;IACE,mCAAmC;;IAEnC;MACE,iFAAiF;IACnF;EACF;AACF;;AAEA,kEAAkE;AAClE,EAAE;AACF,qFAAqF;AACrF,EAAE;AACF,6GAA6G;AAC7G,EAAE;AACF,kBAAkB;;AAElB;EACE,4DAA4D;AAC9D;;AAEA,mEAAmE;AACnE,EAAE;AACF,iEAAiE;AACjE,+CAA+C;AAC/C,EAAE;AACF,6GAA6G;AAC7G,EAAE;AACF,kBAAkB;;AAElB;EACE,yGAAyG;AAC3G","file":"_warnings.scss","sourcesContent":["@use \"sass:list\";\n\n////\n/// Warnings\n///\n/// @group settings/warnings\n////\n\n/// Suppressed warnings map\n///\n/// This map is used to determine which deprecation warnings to **not** show\n/// to users when compiling sass. This is in place for codebases that do not\n/// have the necessary capacity to upgrade and remove the deprecation,\n/// particularly if the deprecation is significant. For example, the removal of\n/// mixins and functions that were previously available to users of frontend.\n///\n/// You can add to this map and define which warnings to suppress by appending to\n/// it using the warning key, found in the warning message. For example:\n///\n/// @example scss\n///   // warning message:\n///   //  $foobar is no longer supported. To silence this warning, update\n///   //  $nhsuk-suppressed-warnings with key: \"foobar\"\n///   $nhsuk-suppressed-warnings: (\n///     foobar\n///   );\n///\n/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)\n\n$nhsuk-suppressed-warnings: () !default;\n\n/// Warnings\n///\n/// Acts as a wrapper for the built in `@warn` sass function\n///\n/// We use this instead of using `@warn` for 3 reasons:\n///\n/// - To check if a warning is being suppressed through `$nhsuk-suppressed-warnings`,\n/// in which case we don't call `@warn` and printing the warning to the user\n/// - To format the passed warning `$message` with the warning key at the end\n/// - To prevent duplicate warnings by adding the passed `$key` to\n/// `$nhsuk-suppressed-warnings` after `@warn` is called to ensure it only runs\n/// once per sass compilation\n///\n/// @param {String} $key - The key to be checked against `$nhsuk-suppressed-warnings`\n/// and then passed to it to prevent multiple of the same warning.\n/// @param {String} $message - The message to use when calling `@warn`\n/// @param {Boolean} $silence-further-warnings - Whether to silence future\n/// warnings that use the same $key\n///\n/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)\n\n@mixin nhsuk-warning($key, $message, $silence-further-warnings: true) {\n  @if _should-warn($key) {\n    @warn _warning-text($key, $message);\n\n    @if $silence-further-warnings {\n      $nhsuk-suppressed-warnings: list.append($nhsuk-suppressed-warnings, $key) !global;\n    }\n  }\n}\n\n/// Check whether a key is present in the suppressed warnings list.\n///\n/// @param {String} $key - The key to be checked against `$nhsuk-suppressed-warnings`.\n///\n/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)\n///\n/// @access private\n\n@function _should-warn($key) {\n  @return list.index($nhsuk-suppressed-warnings, $key) == null;\n}\n\n/// Format a warning by appending information on how to suppress it.\n///\n/// @param {String} $key - The key needed to suppress the warning.\n/// @param {String} $message - The warning text.\n///\n/// @link https://github.com/alphagov/govuk-frontend Original code taken from GDS (Government Digital Service)\n///\n/// @access private\n\n@function _warning-text($key, $message) {\n  @return $message + \" To silence this warning, update $nhsuk-suppressed-warnings \" + 'with key: \"#{$key}\"';\n}\n"]}
