breakpoint-slicer 0.1 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/lib/breakpoint-slicer.rb +1 -1
- data/stylesheets/_breakpoint-slicer.sass +0 -1
- data/stylesheets/breakpoint-slicer/_helper-functions.sass +0 -0
- data/stylesheets/breakpoint-slicer/_mixins.sass +41 -66
- data/stylesheets/breakpoint-slicer/_variables.sass +1 -0
- metadata +11 -14
- data/demo/config.rb +0 -5
- data/demo/sass/screen.sass +0 -127
- data/demo/test.html +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDUwYjJlZjYxMzA4N2IzMjFlZGI0NDUxZWQ3OGY3MWY5YTk2NjUwZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZjM5ZGUzM2I5ODA5Yzk5OTA5OTIxMTgzNDM4OWU5MzY1MWJmMzFlMQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGEzOTI2NmMwZWEwMjZmZDczOWUzOWZiNjg0MGRhMjI0MjhmZGM1MTEyNGVk
|
10
|
+
NjJhOTQ1NmY4N2E5MjQ0NDdiOWQxNjczYWYwMzBmNTNhYjliMjFlMzNjZjU3
|
11
|
+
MjliMzJkODkyODMxODg0N2E0OGM0ZjRiM2U5ZTU1ZGE2OGRkMDM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Y2ViZDNlM2Q5ZTgwNGMxZWRiMDVmMjRlOWZiZTgyNzkxYzdlNTE0MjYzYWJj
|
14
|
+
MjlkNmYzMDA1Mzc3ZWQ3MzMyYTc4NWRkZWZiODBlOGQ1NDU3YWI2NjlkYzU1
|
15
|
+
YzI5ZGE4YTA0YjRkZWUwZjBhNTcxYTE3ZWJlODNjYWU4MDBhMzk=
|
data/lib/breakpoint-slicer.rb
CHANGED
File without changes
|
@@ -4,95 +4,70 @@
|
|
4
4
|
////////////////////////////////////////////////
|
5
5
|
|
6
6
|
// Wraps the content block provided with a media query
|
7
|
-
// with min-width
|
7
|
+
// with min-width equal to the left edge of the left slice
|
8
|
+
// and max-width equal to the right edge of the right slice
|
8
9
|
//
|
9
|
-
//
|
10
|
-
// - $slice
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
$context: left-bp-of-slice($slice)
|
15
|
-
|
16
|
-
// Retrieving the right edge of the slice
|
17
|
-
// unless the slice is the last one
|
18
|
-
@if $slice < total-slices()
|
19
|
-
$right: right-bp-of-slice($slice)
|
20
|
-
$context: append($context, $right)
|
10
|
+
// between($slice-left, $slice-right, $no-query: false)
|
11
|
+
// - $slice-left : <slice number> A number of the left slice. Should be a positive integer.
|
12
|
+
// - $slice-right : <slice number> A number of the left slice. Should be a positive integer.
|
13
|
+
// - $no-query : [<.class>] A class to provide the no-query fallback (see Breakpoint docs).
|
14
|
+
=between($slice-left, $slice-right, $no-query: false)
|
21
15
|
|
22
|
-
//
|
23
|
-
|
16
|
+
// If the slices provided are the first and the last one,
|
17
|
+
// the breakpoint becomes meaningless
|
18
|
+
@if ($slice-left == 1) and ($slice-right == total-slices())
|
19
|
+
//Thus, don't wrap the code block with a media query
|
24
20
|
@content
|
25
21
|
|
22
|
+
@else
|
26
23
|
|
27
|
-
//
|
28
|
-
|
29
|
-
//
|
30
|
-
// from($slice)
|
31
|
-
// - $slice : <slice number> A number of a slice. Should be a positive integer.
|
32
|
-
=from($slice)
|
33
|
-
|
34
|
-
// If the slice is the first one, the breakpoint becomes meaningless
|
35
|
-
@if $slice == 1
|
36
|
-
// Thus, don't wrap the code block with a media query
|
37
|
-
@content
|
24
|
+
// Retrieving the left edge of the left slice
|
25
|
+
$context: left-bp-of-slice($slice-left)
|
38
26
|
|
39
|
-
|
40
|
-
//
|
41
|
-
$
|
27
|
+
// Retrieving the right edge of the slice
|
28
|
+
// unless the slice is the last one
|
29
|
+
@if $slice-right < total-slices()
|
30
|
+
$right: right-bp-of-slice($slice-right)
|
31
|
+
$context: append($context, $right)
|
42
32
|
|
43
33
|
// Setting the breakpoint
|
44
|
-
+breakpoint($context)
|
34
|
+
+breakpoint($context, $no-query)
|
45
35
|
@content
|
46
36
|
|
47
37
|
|
48
38
|
// Wraps the content block provided with a media query
|
49
|
-
// with max-width equal to the
|
39
|
+
// with min-width and max-width equal to the edges of a slice
|
50
40
|
//
|
51
|
-
//
|
41
|
+
// at($slice, $no-query: false)
|
52
42
|
// - $slice : <slice number> A number of a slice. Should be a positive integer.
|
53
|
-
|
43
|
+
// - $no-query : [<.class>] A class to provide the no-query fallback (see Breakpoint docs).
|
44
|
+
=at($slice, $no-query: false)
|
54
45
|
|
55
|
-
|
56
|
-
@if $slice == total-slices()
|
57
|
-
// Thus, don't wrap the code block with a media query
|
46
|
+
+between($slice, $slice, $no-query)
|
58
47
|
@content
|
59
48
|
|
60
|
-
@else
|
61
|
-
// Retrieving the right edge of the slice
|
62
|
-
$right: right-bp-of-slice($slice)
|
63
|
-
$context: max-width $right
|
64
|
-
|
65
|
-
// Setting the breakpoint
|
66
|
-
+breakpoint($context)
|
67
|
-
@content
|
68
|
-
|
69
49
|
|
70
50
|
// Wraps the content block provided with a media query
|
71
|
-
// with min-width equal to the
|
72
|
-
// and max-width equal to the right edge of the right slice
|
51
|
+
// with min-width equal to the right edge of a slice
|
73
52
|
//
|
74
|
-
//
|
75
|
-
// - $slice
|
76
|
-
// - $
|
77
|
-
=
|
53
|
+
// from($slice, $no-query: false)
|
54
|
+
// - $slice : <slice number> A number of a slice. Should be a positive integer.
|
55
|
+
// - $no-query : [<.class>] A class to provide the no-query fallback (see Breakpoint docs).
|
56
|
+
=from($slice, $no-query: false)
|
78
57
|
|
79
|
-
|
80
|
-
// the breakpoint becomes meaningless
|
81
|
-
@if ($slice-left == 1) and ($slice-right == total-slices())
|
82
|
-
//Thus, don't wrap the code block with a media query
|
58
|
+
+between(1, $slice, $no-query)
|
83
59
|
@content
|
84
60
|
|
85
|
-
@else
|
86
61
|
|
87
|
-
|
88
|
-
|
62
|
+
// Wraps the content block provided with a media query
|
63
|
+
// with max-width equal to the right edge of a slice
|
64
|
+
//
|
65
|
+
// to($slice, $no-query: false)
|
66
|
+
// - $slice : <slice number> A number of a slice. Should be a positive integer.
|
67
|
+
// - $no-query : [<.class>] A class to provide the no-query fallback (see Breakpoint docs).
|
68
|
+
=to($slice, $no-query: false)
|
69
|
+
|
70
|
+
+between($slice, total-slices(), $no-query)
|
71
|
+
@content
|
89
72
|
|
90
|
-
// Retrieving the right edge of the slice
|
91
|
-
// unless the slice is the last one
|
92
|
-
@if $slice-right < total-slices()
|
93
|
-
$right: right-bp-of-slice($slice-right)
|
94
|
-
$context: append($context, $right)
|
95
73
|
|
96
|
-
// Setting the breakpoint
|
97
|
-
+breakpoint($context)
|
98
|
-
@content
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breakpoint-slicer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0
|
4
|
+
version: '1.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey 'lolmaus' Mikhaylov
|
@@ -14,42 +14,42 @@ dependencies:
|
|
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
|
@@ -61,12 +61,9 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- lib/breakpoint-slicer.rb
|
63
63
|
- stylesheets/breakpoint-slicer/_helper-functions.sass
|
64
|
-
- stylesheets/breakpoint-slicer/_variables.sass
|
65
64
|
- stylesheets/breakpoint-slicer/_mixins.sass
|
65
|
+
- stylesheets/breakpoint-slicer/_variables.sass
|
66
66
|
- stylesheets/_breakpoint-slicer.sass
|
67
|
-
- demo/config.rb
|
68
|
-
- demo/test.html
|
69
|
-
- demo/sass/screen.sass
|
70
67
|
homepage: https://github.com/lolmaus/breakpoint-slicer
|
71
68
|
licenses: []
|
72
69
|
metadata: {}
|
@@ -76,17 +73,17 @@ require_paths:
|
|
76
73
|
- lib
|
77
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
75
|
requirements:
|
79
|
-
- - '>='
|
76
|
+
- - ! '>='
|
80
77
|
- !ruby/object:Gem::Version
|
81
78
|
version: '0'
|
82
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
80
|
requirements:
|
84
|
-
- - '>='
|
81
|
+
- - ! '>='
|
85
82
|
- !ruby/object:Gem::Version
|
86
83
|
version: '1.2'
|
87
84
|
requirements: []
|
88
85
|
rubyforge_project: singularitygs
|
89
|
-
rubygems_version: 2.0.
|
86
|
+
rubygems_version: 2.0.3
|
90
87
|
signing_key:
|
91
88
|
specification_version: 4
|
92
89
|
summary: Along with Respond To, Breakpoint Slicer is an alternative syntax for Breakpoint.
|
data/demo/config.rb
DELETED
data/demo/sass/screen.sass
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
@import breakpoint
|
2
|
-
@import ../../stylesheets/breakpoint-slicer
|
3
|
-
|
4
|
-
/////////////////////////////////////////
|
5
|
-
// Showing the info
|
6
|
-
/////////////////////////////////////////
|
7
|
-
|
8
|
-
// Showing the breakpoints
|
9
|
-
#info-1:after
|
10
|
-
content: "$slicer-breakpoints: #{$slicer-breakpoints}"
|
11
|
-
|
12
|
-
// Showing the number of slices
|
13
|
-
#info-2:after
|
14
|
-
@for $i from 1 through total-slices()
|
15
|
-
+at($i)
|
16
|
-
content: "This window currently fits #{$i} slices."
|
17
|
-
|
18
|
-
|
19
|
-
/////////////////////////////////////////
|
20
|
-
// Testing +at
|
21
|
-
/////////////////////////////////////////
|
22
|
-
|
23
|
-
#at
|
24
|
-
+at(3)
|
25
|
-
background-color: black
|
26
|
-
color: white
|
27
|
-
|
28
|
-
|
29
|
-
/////////////////////////////////////////
|
30
|
-
// Testing +from
|
31
|
-
/////////////////////////////////////////
|
32
|
-
|
33
|
-
#from
|
34
|
-
+from(3)
|
35
|
-
background-color: black
|
36
|
-
color: white
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
/////////////////////////////////////////
|
41
|
-
// Testing +to
|
42
|
-
/////////////////////////////////////////
|
43
|
-
|
44
|
-
#to
|
45
|
-
+to(3)
|
46
|
-
background-color: black
|
47
|
-
color: white
|
48
|
-
|
49
|
-
|
50
|
-
/////////////////////////////////////////
|
51
|
-
// Testing +between
|
52
|
-
/////////////////////////////////////////
|
53
|
-
|
54
|
-
#between
|
55
|
-
+between(2,4)
|
56
|
-
background-color: black
|
57
|
-
color: white
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
/////////////////////////////////////////
|
62
|
-
// Breakpoint Slicer with Singularity
|
63
|
-
/////////////////////////////////////////
|
64
|
-
|
65
|
-
// Importing Singularity
|
66
|
-
@import compass
|
67
|
-
@import singularitygs
|
68
|
-
|
69
|
-
// Configuring Singularity with Breakpoint Slicer
|
70
|
-
$grids: 1
|
71
|
-
@for $i from 2 through total-slices()
|
72
|
-
$grids: add-grid($i at bp($i))
|
73
|
-
|
74
|
-
$gutters: 0.2
|
75
|
-
|
76
|
-
|
77
|
-
// Enabling the grid background
|
78
|
-
#singularity
|
79
|
-
+background-grid
|
80
|
-
+pie-clearfix
|
81
|
-
|
82
|
-
|
83
|
-
// Spanning the column
|
84
|
-
#singularity .column
|
85
|
-
|
86
|
-
// Showing the text.
|
87
|
-
span:after
|
88
|
-
content: "This column is not spanned."
|
89
|
-
|
90
|
-
// Cycling through slices
|
91
|
-
@for $i from 2 through total-slices()
|
92
|
-
|
93
|
-
// Setting a media query per slice
|
94
|
-
+at($i)
|
95
|
-
|
96
|
-
// Setting the position to be the last-but-one column
|
97
|
-
$position: $i - 1
|
98
|
-
|
99
|
-
// Spanning
|
100
|
-
+grid-span(1, $position)
|
101
|
-
|
102
|
-
// Showing the text.
|
103
|
-
span:after
|
104
|
-
content: "+at(#{$i})\A +grid-span(1, #{$position})"
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
/////////////////////////////////////////
|
109
|
-
// Styling
|
110
|
-
/////////////////////////////////////////
|
111
|
-
*
|
112
|
-
+box-sizing(border-box)
|
113
|
-
|
114
|
-
p
|
115
|
-
margin-bottom: 1em
|
116
|
-
|
117
|
-
h2
|
118
|
-
margin-top: 2em
|
119
|
-
|
120
|
-
.demo
|
121
|
-
p, .column
|
122
|
-
font-family: monospace
|
123
|
-
border: 1px solid black
|
124
|
-
background-color: lightgrey
|
125
|
-
padding: 1em
|
126
|
-
|
127
|
-
|
data/demo/test.html
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Breakpoint Slicer test</title>
|
5
|
-
<link rel=stylesheet href=css/screen.css>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
|
9
|
-
<h1>Breakpoint Slicer demo</h1>
|
10
|
-
|
11
|
-
<p>Please play with browser window width.</p>
|
12
|
-
<p id=info-1></p>
|
13
|
-
<p id=info-2></p>
|
14
|
-
|
15
|
-
|
16
|
-
<h2>Testing mixins</h2>
|
17
|
-
|
18
|
-
<p>The default color of each paragraph is light grey.
|
19
|
-
Breakpoint Slicer is used to change the color to black at certain window widths.</p>
|
20
|
-
|
21
|
-
<section class=demo>
|
22
|
-
<p id=at>+at(3)<br> background-color: black</p>
|
23
|
-
<p id=from>+from(3)<br> background-color: black</p>
|
24
|
-
<p id=to>+to(3)<br> background-color: black</p>
|
25
|
-
<p id=between>+between(2, 4)<br> background-color: black</p>
|
26
|
-
</section>
|
27
|
-
|
28
|
-
<h2>Testing Breakpoint Slicer with Singularity</h2>
|
29
|
-
|
30
|
-
<p>Breakpoint Slicer is used to set Singularity's breakpoints and to span the column.</p>
|
31
|
-
|
32
|
-
<section class=demo>
|
33
|
-
<div id=singularity>
|
34
|
-
<div class=column><pre><span></span></pre></div>
|
35
|
-
</div>
|
36
|
-
</section>
|
37
|
-
|
38
|
-
|
39
|
-
</body>
|
40
|
-
</html>
|