breakpoint-slicer 1.1 → 1.2
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
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NGMwNzFkNWJkODI4MGY1ZmI1YjYzYTU2MmVkZjdkMGMwMzI5ODkzZmNiY2U4
|
10
|
-
MTFmOTdhODZkNDg0ODNmYTZlZjJiNzk1ZmM4MzZjNjdiNmRjMzkxZTkwYzA5
|
11
|
-
OWU4YTJjMWExZDkzN2RhZTYwN2EzZTRjZGVhNjc2NDhhYmMxNzA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjIzZjgwMDM5ZDM3NzU2ODdjNDVhMTk0NTY1MmI0NjNjNWQwNTNjZTMzNjMz
|
14
|
-
ZjY2MmFlYzZjZTgyZGUyYjRlZmE2ZDU1MWZiZTQ3OWJkMzI0MDMwMjQzN2Y2
|
15
|
-
ZTI1M2QxZjYwYjE4NTExZTIwYTI1YjdhOTkxNDZjNTk5OTg1ZDQ=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 733c03ddb67c655836eed3621182c391227c6534
|
4
|
+
data.tar.gz: 5910b64058254718d1f0a01305ad81564fe5d0c8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: febd0203a58031e1a523b0bd362a0048e1d21978ace9d05062f734b1299847c357e8f60a0131c52ce93ced70cf7c298117af54513943741a689fc10aa152719b
|
7
|
+
data.tar.gz: eea919c27091c2411fdbf93c1109c081f04783bfb553b59abf474da366a8653961b41c602e008df86bb93953cf7d3fe76397dd7066887e969f6b7ff53aca26e3
|
data/lib/breakpoint-slicer.rb
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
// Returns a correction value for the given breakpoint
|
2
|
+
// to prevent media query overlapping.
|
3
|
+
//
|
4
|
+
// Relies on the global variable $slicer-anti-overlap-corrections
|
5
|
+
// that should contain a list of allowed correction values.
|
6
|
+
//
|
7
|
+
// Returns either only positive or only negative value.
|
8
|
+
//
|
9
|
+
// anti-overlap-correction($bp, $positive: true)
|
10
|
+
// - $bp : a breakpoint, e. g. 800px or 20em
|
11
|
+
// - $positive : whether to return only positive or only negative values
|
12
|
+
// * true - return only positive correction value (default)
|
13
|
+
// * false - return only negative correction value //
|
14
|
+
@function anti-overlap-correction($bp, $positive: true)
|
15
|
+
@each $correction in $slicer-anti-overlap-corrections
|
16
|
+
@if (unit($bp) == unit($correction)) and (($correction > 0) == $positive)
|
17
|
+
@return $correction
|
18
|
+
@return 0
|
19
|
+
|
20
|
+
|
1
21
|
// total-slices()
|
2
22
|
//
|
3
23
|
// Accepts no arguments.
|
@@ -23,14 +43,18 @@
|
|
23
43
|
|
24
44
|
@else
|
25
45
|
|
26
|
-
|
27
|
-
$left: nth($slicer-breakpoints, $slice)
|
46
|
+
$left: i am declared
|
28
47
|
|
29
48
|
// Special treatment of the first slice...
|
30
49
|
@if $slice == 1
|
31
50
|
// ...to prevent a meaningless `min-width: 0` meida query
|
32
51
|
$left: max-width // This is Breakpoint's syntax
|
33
52
|
|
53
|
+
@else
|
54
|
+
// Returning the left edge of the slice
|
55
|
+
$left: nth($slicer-breakpoints, $slice)
|
56
|
+
$left: $left + anti-overlap-correction($left, true)
|
57
|
+
|
34
58
|
@return $left
|
35
59
|
|
36
60
|
|
@@ -48,8 +72,9 @@
|
|
48
72
|
@else if ($slice < $min) or ($slice > $max)
|
49
73
|
@warn "Wrong column number provided: #{$slice}. Should be between #{min} and #{$max}."
|
50
74
|
@else
|
51
|
-
//
|
52
|
-
|
75
|
+
// Reading the right edge of the slice
|
76
|
+
$right-bp: nth($slicer-breakpoints, $slice + 1)
|
77
|
+
@return $right-bp + anti-overlap-correction($right-bp, false)
|
53
78
|
|
54
79
|
|
55
80
|
// bp($slice)
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breakpoint-slicer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey 'lolmaus' Mikhaylov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: compass
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.12.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.12.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: breakpoint
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.0.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.0.1
|
55
55
|
description: A very quick and efficient syntax for Breakpoint
|
@@ -73,17 +73,17 @@ require_paths:
|
|
73
73
|
- lib
|
74
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - '>='
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '1.2'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project: singularitygs
|
86
|
-
rubygems_version: 2.0.
|
86
|
+
rubygems_version: 2.0.0
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Along with Respond To, Breakpoint Slicer is an alternative syntax for Breakpoint.
|