From 3e0da2bf7f93eb8dc1fc5f420efb93969f7632e1 Mon Sep 17 00:00:00 2001 From: zgabievi Date: Wed, 6 Apr 2016 22:13:31 +0400 Subject: [PATCH] get block fix --- _bem.scss | 8 ++++---- bower.json | 2 +- functions/_get-block.scss | 11 ++++++++++- package.json | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/_bem.scss b/_bem.scss index f4648e2..40d465a 100644 --- a/_bem.scss +++ b/_bem.scss @@ -10,13 +10,13 @@ // Functions @import "functions/bem-index"; -@import "functions/get-block"; -@import "functions/has-state"; -@import "functions/has-pseudo"; -@import "functions/str-replace"; @import "functions/is-modifier"; @import "functions/is-element"; +@import "functions/has-state"; +@import "functions/has-pseudo"; @import "functions/is-block"; +@import "functions/get-block"; +@import "functions/str-replace"; @import "functions/math-min"; @import "functions/explode"; @import "functions/implode"; diff --git a/bower.json b/bower.json index 00ff0e5..fccf96b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "sass-bem", - "version": "2.5.0", + "version": "2.5.1", "main": "_bem.scss", "description": "Collection of BEM Mixins & Helpers", "authors": [ diff --git a/functions/_get-block.scss b/functions/_get-block.scss index b335d9d..ed88545 100644 --- a/functions/_get-block.scss +++ b/functions/_get-block.scss @@ -9,5 +9,14 @@ /// @returns {String} - Block element @function get-block($selector) { - @return str-slice($selector, 2, bem-index($selector) - 1); + $block: str-slice($selector, 2, bem-index($selector) - 1); + + // + @while (is-block($block) == false) { + + // + $block: str-slice($block, 0, bem-index($block) - 1); + } + + @return $block; } \ No newline at end of file diff --git a/package.json b/package.json index ee716c6..de445f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sass-bem", - "version": "2.5.0", + "version": "2.5.1", "description": "Collection of BEM Mixins & Helpers", "main": "_bem.scss", "repository": {