Sha256: cad20cb55cae465b040ba9c1c0ea3514095979548413f8e547ea67ab1fe2f843

Contents?: true

Size: 1.06 KB

Versions: 517

Compression:

Stored size: 1.06 KB

Contents

////
/// @group tools
////

/// List of modules which have already been exported
///
/// @type List
/// @access private

$_govuk-imported-modules: () !default;

/// Export module
///
/// Ensure that the modules of CSS that we define throughout Frontend are only
/// included in the generated CSS once, no matter how many times they are
/// imported across the individual components.
///
/// @param {String} $name - Name of module - must be unique within the codebase
/// @content The passed content will only be outputted if a module of the same
///   $name has not already been outputted
/// @access public

@mixin govuk-exports($name) {
  // If the mixin is not in the list of modules already exported...
  @if (index($_govuk-imported-modules, $name) == null) {
    // ... then add it to the list
    $_govuk-imported-modules: append($_govuk-imported-modules, $name) !global;
    // ... and output the CSS for that module
    @content;
  }
  // The next time exports is called for the module of the same name, it will be
  // found in the list and so nothing will be outputted.
}

Version data entries

517 entries across 514 versions & 5 rubygems

Version Path
govuk_publishing_components-27.14.1 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.14.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.13.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
dxw_govuk_frontend_rails-3.14.0 vendor/assets/stylesheets/tools/_exports.scss
dxw_govuk_frontend_rails-3.13.1 vendor/assets/stylesheets/tools/_exports.scss
dxw_govuk_frontend_rails-3.12.0 vendor/assets/stylesheets/tools/_exports.scss
govuk_publishing_components-27.12.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.11.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.5 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.4 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.3 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.2 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.1 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.10.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.9.2 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.9.1 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.9.0 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.8.2 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.8.1 node_modules/govuk-frontend/govuk/tools/_exports.scss
govuk_publishing_components-27.8.0 node_modules/govuk-frontend/govuk/tools/_exports.scss