UNPKG

govuk-frontend

Version:

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.

2 lines (1 loc) 2.2 kB
{"version":3,"sources":["../../../src/govuk/tools/_rebrand.scss"],"names":[],"mappings":"AAAA,GAAG;AACH,eAAe;AACf,GAAG;;AAEH,0DAA0D;AAC1D,EAAE;AACF,sDAAsD;AACtD,WAAW;AACX,yBAAyB;AACzB,2BAA2B;AAC3B,EAAE;AACF,kCAAkC;AAClC,4BAA4B;AAC5B,6BAA6B;AAC7B,QAAQ;AACR,MAAM;AACN,EAAE;AACF,yCAAyC;AACzC,WAAW;AACX,0EAA0E;AAC1E,MAAM;AACN,EAAE;AACF,EAAE;AACF,uEAAuE;AACvE,6DAA6D;AAC7D,4DAA4D;AAC5D,gEAAgE;AAChE,kBAAkB;AAClB;EACE;IACE;MACE,2DAA2D;IAC7D;;IAEA;MACE,0DAA0D;IAC5D;;IAEA,sBAAsB;;IAEtB;MACE,oBAAoB;IACtB;EACF,EAAE;IACA;MACE,QAAQ;IACV;EACF;AACF;;AAEA;EACE,iBAAiB;;EAEjB;IACE;MACE,QAAQ;IACV;EACF,EAAE;IACA;MACE,QAAQ;IACV;EACF;AACF","file":"_rebrand.scss","sourcesContent":["////\n/// @group tools\n////\n\n/// Wraps rebranded properties in the feature flag selector\n///\n/// @example scss - Wrap a block of multiple properties\n/// .foo {\n/// border-width: 1px;\n/// border-colour: #fff;\n///\n/// @include _govuk-rebrand() {\n/// border-width: 10px;\n/// border-colour: #000;\n/// }\n/// }\n///\n/// @example scss - Wrap a single property\n/// .foo {\n/// @include _govuk-rebrand(\"background-color\", $from: #fff, $to: #000)\n/// }\n///\n///\n/// @param {String} $property - The name of the property being rebranded\n/// @param {String} $from - The original value of the property\n/// @param {String} $to - The rebranded value of the property\n/// @throw if `$property` is set but `$from` or `$to` are missing\n/// @access private\n@mixin _govuk-rebrand($property: null, $from: null, $to: null) {\n @if $property {\n @if not $from {\n @error \"`_govuk-rebrand` needs the original value, `$from`\";\n }\n\n @if not $to {\n @error \"`_govuk-rebrand` needs the rebranded value, `$to`\";\n }\n\n #{$property}: #{$from};\n\n @include _govuk-rebrand-wrapper {\n #{$property}: #{$to};\n }\n } @else {\n @include _govuk-rebrand-wrapper {\n @content;\n }\n }\n}\n\n@mixin _govuk-rebrand-wrapper() {\n $selector: \"#{&}\";\n\n @if $selector == \".govuk-template\" {\n @at-root .govuk-template--rebranded {\n @content;\n }\n } @else {\n .govuk-template--rebranded & {\n @content;\n }\n }\n}\n"]}