rails_blocks 0.7.9 → 0.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/rails_blocks.sass +35 -50
- data/lib/rails_blocks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c2eaeee389ac41547e2bc5ffff58ad1fcd84e51
|
4
|
+
data.tar.gz: 26799cba32acfebe52ac62694473b3ac40afceb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17c0ec7aac3c95a1c59f42c4f58924290c01336f63662414b284664321809d5ccba579d5e491eed89afbfdc28b39d3e2ac995a4c212c64348ccd7c6aa26b24b7
|
7
|
+
data.tar.gz: 313b5e1c935783241c3f1a6c9fc9ec1990711c910c2f72ab7f41405ad28c6e1d4d8e1fea7b4f8c6b2c0cead2483f7c5bd51c0066903056c84ce2ddc6fa55fa56
|
@@ -3,75 +3,62 @@ $bemModifierSeparator: '--'
|
|
3
3
|
|
4
4
|
@function b-class($block)
|
5
5
|
@return ".#{$block}"
|
6
|
-
|
7
|
-
@function
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
|
7
|
+
@function e-class($block, $element)
|
8
|
+
@return ".#{$block+$bemElementSeparator+$element}"
|
9
|
+
|
10
|
+
@function m-class($selector, $modifier)
|
11
|
+
@return "#{$selector+$bemModifierSeparator+$modifier}"
|
11
12
|
|
12
13
|
@function containsModifier($selector)
|
13
|
-
$selector:
|
14
|
-
@if
|
15
|
-
@return true
|
16
|
-
@else
|
17
|
-
@return false
|
14
|
+
$selector: inspect($selector)
|
15
|
+
@return if(str-index($selector, $bemModifierSeparator), true, false)
|
18
16
|
|
19
17
|
@function containsPseudo($selector)
|
20
|
-
$selector:
|
21
|
-
@if
|
22
|
-
@return true
|
23
|
-
@else
|
24
|
-
@return false
|
18
|
+
$selector: inspect($selector)
|
19
|
+
@return if(str-index($selector, ':'), true, false)
|
25
20
|
|
26
21
|
@function containsElement($selector)
|
27
|
-
$selector:
|
28
|
-
@if
|
29
|
-
@return true
|
30
|
-
@else
|
31
|
-
@return false
|
22
|
+
$selector: inspect($selector)
|
23
|
+
@return if(str-index($selector, $bemElementSeparator), true, false)
|
32
24
|
|
33
25
|
@function getBlock($selector)
|
34
|
-
$selector:
|
26
|
+
$selector: inspect($selector)
|
35
27
|
$elementStart: str-index($selector, $bemElementSeparator)
|
36
28
|
$modifierStart: str-index($selector, $bemModifierSeparator)
|
37
29
|
$pseudoStart: str-index($selector, ':')
|
38
|
-
$start: if($elementStart, $elementStart - 1, if($modifierStart, $modifierStart - 1, $pseudoStart - 1))
|
39
|
-
@return str-slice($selector,
|
30
|
+
$start: if($elementStart, $elementStart - 1, if($modifierStart, $modifierStart - 1, if($pseudoStart, $pseudoStart - 1, -1)))
|
31
|
+
@return str-slice($selector, 2, $start) //without dot
|
40
32
|
|
41
|
-
=b($
|
42
|
-
|
33
|
+
=b($blocks...)
|
34
|
+
$selectors: ()
|
35
|
+
@each $block in $blocks
|
36
|
+
$selectors: append($selectors, #{b-class($block)}, 'comma')
|
37
|
+
#{$selectors}
|
43
38
|
@content
|
44
|
-
|
45
|
-
=plus_b
|
46
|
-
@at-root
|
47
|
-
$block: &
|
48
|
-
#{$block} + #{$block}
|
49
|
-
@content
|
50
|
-
|
51
|
-
=hover_b
|
52
|
-
@at-root
|
53
|
-
$block: &
|
54
|
-
#{$block}:hover
|
55
|
-
@content
|
56
39
|
|
57
40
|
=e($elements...)
|
58
41
|
$selectors: ()
|
59
|
-
$
|
42
|
+
$parentSelector: &
|
60
43
|
|
61
|
-
@each $
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
44
|
+
@each $currentSelector in $parentSelector
|
45
|
+
$block: getBlock($currentSelector)
|
46
|
+
@each $element in $elements
|
47
|
+
@if containsModifier($currentSelector) or containsPseudo($currentSelector)
|
48
|
+
$selectors: append($selectors, #{$currentSelector e-class($block, $element)}, 'comma')
|
49
|
+
@else
|
50
|
+
$selectors: append($selectors, e-class($block, $element), 'comma')
|
51
|
+
|
67
52
|
@at-root
|
68
53
|
#{$selectors}
|
69
54
|
@content
|
70
55
|
|
71
56
|
=m($modifiers...)
|
72
57
|
$selectors: ()
|
73
|
-
|
74
|
-
|
58
|
+
$parentSelector: &
|
59
|
+
@each $currentSelector in $parentSelector
|
60
|
+
@each $modifier in $modifiers
|
61
|
+
$selectors: append($selectors, m-class($currentSelector, $modifier), 'comma')
|
75
62
|
@at-root
|
76
63
|
#{$selectors}
|
77
64
|
@content
|
@@ -79,7 +66,7 @@ $bemModifierSeparator: '--'
|
|
79
66
|
=ms($modifiers...)
|
80
67
|
$selectors: null
|
81
68
|
@each $modifier in $modifiers
|
82
|
-
$selectors: $selectors#{
|
69
|
+
$selectors: $selectors#{m-class(&, $modifier)}
|
83
70
|
@at-root
|
84
71
|
#{$selectors}
|
85
72
|
@content
|
@@ -94,7 +81,5 @@ $bemModifierSeparator: '--'
|
|
94
81
|
background-position: -($i - 1) * $width (-2 * $height)
|
95
82
|
|
96
83
|
@function block-image-url($level, $image)
|
97
|
-
$
|
98
|
-
$selector: selectorToString($selector)
|
99
|
-
$block: if(containsModifier($selector) or containsPseudo($selector) or containsElement($selector), getBlock($selector), selectorToString($selector))
|
84
|
+
$block: getBlock(nth(&, 1))
|
100
85
|
@return image-url("#{$level}/#{$block}/images/#{$image}")
|
data/lib/rails_blocks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Potetiurin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|