Sha256: 7282708140db678480b2bd042b63f53e367bd197d925da2f63962fb64f415b27

Contents?: true

Size: 841 Bytes

Versions: 4

Compression:

Stored size: 841 Bytes

Contents

// -----------------------------------------------------------------------------
// Block Logger
// -----------------------------------------------------------------------------

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

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

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

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

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

    // Initialize a new block map
    $new-block: ($block: ('elements': (), 'modifiers': ()));

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

    // Everything OK
    @return true;
}

Version data entries

4 entries across 4 versions & 1 rubygems

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