Sha256: af0f858bc1ebcbea1a5d860c7f1b57c7c682b5abcd03ca8f99b8ab7d8d929b6f

Contents?: true

Size: 810 Bytes

Versions: 4

Compression:

Stored size: 810 Bytes

Contents

// -----------------------------------------------------------------------------
// Scope Logger
// -----------------------------------------------------------------------------

/// Find if a given $scope has already been created
/// @param {String} $scope - Name of the scope

@function scope-exists($scope) {
    @return map-has-key($_bem-log, $scope);
}

/// Log the new $scope
/// @param {String} $scope - scope name

@function _bem-log-scope($scope) {

    // Check if the scope has already been created
    @if scope-exists($scope) {
        @error '`#{$scope}` scope has already been created';
    }

    // Initialize a new scope map
    $new-scope: ($scope: ());

    // Update bem log with new scope
    $_bem-log: map-merge($_bem-log, $new-scope) !global;

    // Everything OK
    @return true;
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bem-constructor-0.3.0 stylesheets/logger/_scope-logger.scss
bem-constructor-0.2.0 stylesheets/logger/_scope-logger.scss
bem-constructor-0.1.1 stylesheets/logger/_scope-logger.scss
bem-constructor-0.1 stylesheets/logger/_scope-logger.scss