bem-constructor 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b9f377ac2844b2e29439656b8ea795caee5e925
4
- data.tar.gz: 6522e754bab2703329555864d0edee404cb3e330
3
+ metadata.gz: d11930fa21da375d2a8a296532b5f291c0efe5d0
4
+ data.tar.gz: f7e1a7c6ff487e57ce0cc2e75ae2772e80cb32d2
5
5
  SHA512:
6
- metadata.gz: 338df5a582de055c92b5bb917d6673614da3b9708f8781f0b6ddd680db2a1b563abade48e1f2306fb16bdf9ae48e756f318d553c34b95bede1873c9e49bd180e
7
- data.tar.gz: 347ebc42e58d0a8b9da81cfeb1a5e27fd0b8261a9ff89cff97d3a5bf3e196bda1c2dc467520509d1662d19f9cf4e0051071e8fbcff7627569e4233523e235c66
6
+ metadata.gz: ffe52aba896baedcc044316b7ecc253e6ec5ab453272441accda4848eddce79701d878dc959f59b08fb996f9095b3e5f8079d7da227a85b76f9da793ad4e35c3
7
+ data.tar.gz: 4e5e72fd167fa8f9eeaeed0c00db110b4b31985c86111e96b613e2a6b6a799f38eee2d82246faeec8bb74ad4d3880c79157183adcd0952f9b00206d79d8ca850
@@ -3,6 +3,6 @@ extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
3
  Compass::Frameworks.register('bem-constructor', :path => extension_path)
4
4
 
5
5
  module BEMConstructor
6
- VERSION = "0.3.2"
6
+ VERSION = "0.4.0"
7
7
  DATE = "2015-03-26"
8
8
  end
@@ -13,15 +13,16 @@
13
13
  @function _should-be-called-within($objs...) {
14
14
 
15
15
  @each $obj in $objs {
16
- @if map-get($_bem-current-context, $obj) == null {
17
- @if $bem-throw-errors {
18
- @error 'It should be called within #{inspect($objs)}';
19
- }
20
- @return false;
16
+ @if map-get($_bem-current-context, $obj) != null {
17
+ @return true;
21
18
  }
22
19
  }
23
20
 
24
- @return true;
21
+ @if $bem-throw-errors {
22
+ @error 'It should be called within #{inspect($objs)}';
23
+ }
24
+
25
+ @return false;
25
26
  }
26
27
 
27
28
 
@@ -9,10 +9,11 @@
9
9
 
10
10
  @function _modifies-element($modified-elements...) {
11
11
 
12
- $inside-check: _should-be-called-within('modifier', 'state');
12
+ $inside-check: _should-be-called-within('modifier', 'state', 'theme');
13
13
  $outside-check: _should-not-be-called-within('element');
14
14
 
15
- @if $inside-check == 'false' or $outside-check == false {
15
+ // Return false in case error throwing is disabled
16
+ @if $inside-check == false or $outside-check == false {
16
17
  @return false;
17
18
  }
18
19
 
@@ -23,7 +24,9 @@
23
24
  $selectors: append($selectors, $element, 'comma');
24
25
  }
25
26
 
26
- $selector: selector-nest(&, $selectors);
27
+ $block: selector-append(&...);
28
+
29
+ $selector: selector-nest($block, '>', $selectors);
27
30
 
28
31
  $set-current: set-current-context('modifies-element', $modified-elements, $selector);
29
32
 
@@ -17,10 +17,13 @@ $bem-scope-namespace: 's';
17
17
  // Log new block
18
18
  $new-scope: _bem-log-scope($scope);
19
19
 
20
- // Check it's not called inside another scope
21
- // and it's called at the root-level
22
- $recursive-check: should-not-be-called-recursively('scope');
23
- $outside-check: should-not-be-called-within('block');
20
+ // Error checks
21
+ $outside-check: _should-not-be-called-within('block', 'scope');
22
+
23
+ // Return false in case error throwing is disabled
24
+ @if $outside-check == false {
25
+ @return false;
26
+ }
24
27
 
25
28
  $namespace: if($bem-use-namespaces, $bem-scope-namespace + '-', '');
26
29
  $selector: '.' + $namespace + $scope;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bem-constructor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Guillan