breakup 1.0.0 → 1.0.1
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.
- data/Gemfile +4 -0
- data/Gemfile.lock +10 -0
- data/Makefile +1 -1
- data/PACKAGING.md +17 -0
- data/README.md +16 -5
- data/lib/breakup/version.rb +1 -1
- data/package.json +1 -1
- data/stylesheets/_breakup.scss +56 -2
- metadata +5 -3
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/Makefile
CHANGED
data/PACKAGING.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Packaging
|
2
|
+
=========
|
3
|
+
|
4
|
+
Because I do this so rarely I need a thing to remind me
|
5
|
+
|
6
|
+
Version bump lib/breakup/version.rb and in package.json
|
7
|
+
|
8
|
+
Git tag the commit
|
9
|
+
git tag 1.0.0 && git push origin 1.0.0
|
10
|
+
|
11
|
+
Build gem and release
|
12
|
+
gem build breakup.gemspec
|
13
|
+
gem push breakup-1.0.0.gem
|
14
|
+
|
15
|
+
Build npm package and release
|
16
|
+
|
17
|
+
npm publish . --tag 1.0.0
|
data/README.md
CHANGED
@@ -31,17 +31,28 @@ basic styles and the unwrapped wide styles so oldIE is given the wide view).
|
|
31
31
|
|
32
32
|
## Installation
|
33
33
|
|
34
|
-
Breakup is
|
35
|
-
|
34
|
+
Breakup is compatible with both the origial ruby version of Sass and libsass.
|
35
|
+
It is available as a rubygem and an npm package. If you don't wish to use either
|
36
|
+
of these package managers you can also copy
|
37
|
+
[stylesheets/_breakup.scss](stylesheets/_breakup.scss) into your project and
|
38
|
+
`@import` it from there, as Breakup is written in pure SCSS and has no external
|
39
|
+
dependencies.
|
40
|
+
|
41
|
+
### Ruby
|
42
|
+
|
43
|
+
Breakup is distributed as a Compass plugin.
|
36
44
|
|
37
45
|
* Run `gem install breakup` or add breakup to your Gemfile.
|
38
46
|
* Add `require "breakup"` to the top of your compass.rb
|
39
47
|
* Add `@import 'breakup';` to your base stylesheets
|
40
48
|
|
41
|
-
|
42
|
-
|
43
|
-
|
49
|
+
### Node
|
50
|
+
|
51
|
+
Breakup is distributed as an npm package.
|
44
52
|
|
53
|
+
* Run `npm install breakup-sass --save-dev`
|
54
|
+
* Add `@import 'node_modules/breakup-sass/stylesheets/breakup';` to your base
|
55
|
+
stylesheets
|
45
56
|
|
46
57
|
## Usage
|
47
58
|
|
data/lib/breakup/version.rb
CHANGED
data/package.json
CHANGED
data/stylesheets/_breakup.scss
CHANGED
@@ -59,6 +59,60 @@ $breakup-breakpoints-allow-naked: () !default;
|
|
59
59
|
|
60
60
|
|
61
61
|
|
62
|
+
// Merge a list of breakpoints into an already defined $breakup-breakpoints
|
63
|
+
// list. Returns null, as it manipulates the $breakup-breakpoints list directly.
|
64
|
+
//
|
65
|
+
// $breakpoints: A list of lists in the same style as $breakup-breakpoints, that
|
66
|
+
// shall be merged into the $breakup-breakpoints list.
|
67
|
+
@function breakup-add-breakpoints($breakpoints) {
|
68
|
+
@each $breakpoint in $breakpoints {
|
69
|
+
// Assign to a junk variable as sass doesn't let you run a function just
|
70
|
+
// for its side effects
|
71
|
+
$breakup-tmp: breakup-add-breakpoint($breakpoint...);
|
72
|
+
}
|
73
|
+
@return null;
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
// Wrapper around index as its return value differs from Sass 3.4 upwards.
|
79
|
+
// Sass 3.2, 3.3 and libsass return false if the item is not found
|
80
|
+
// Sass 3.4 returns null if the item is not found
|
81
|
+
// This function follows the Sass 3.4 convention of returning null
|
82
|
+
//
|
83
|
+
// $list: The list to search through
|
84
|
+
// $value: The value to search for
|
85
|
+
@function breakup-index($list, $value) {
|
86
|
+
$index-result: index($list, $value);
|
87
|
+
@if $index-result {
|
88
|
+
@return $index-result;
|
89
|
+
}
|
90
|
+
@else {
|
91
|
+
@return null;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
// Merge a single breakpoint into an already defined $breakup-breakpoints list.
|
98
|
+
// Returns null, as it manipulates the $breakup-breakpoints list directly.
|
99
|
+
//
|
100
|
+
// $breakpoint-name: The name of the breakpoint to add
|
101
|
+
// $value: The media query value to add
|
102
|
+
@function breakup-add-breakpoint($breakpoint-name, $value) {
|
103
|
+
// Check the breakpoint-name doesn't already exist.
|
104
|
+
// If if already exists, throw a warning saying the shall be overwritten
|
105
|
+
@if breakup-list-key-search($breakup-breakpoints, $breakpoint-name) != false {
|
106
|
+
@warn 'Attempting to add "#{$breakpoint-name}" to $breakup-breakpoints but it already exists. Refusing to write the new value.';
|
107
|
+
@return null;
|
108
|
+
}
|
109
|
+
|
110
|
+
$breakup-breakpoints: append($breakup-breakpoints, ($breakpoint-name $value));
|
111
|
+
@return null;
|
112
|
+
}
|
113
|
+
|
114
|
+
|
115
|
+
|
62
116
|
// Wrapper around a @media block. if $breakup-naked is true then the
|
63
117
|
// content is output directly if the declaration has been marked as a fallback
|
64
118
|
// breakpoint.
|
@@ -89,7 +143,7 @@ $breakup-breakpoints-allow-naked: () !default;
|
|
89
143
|
//
|
90
144
|
// $block-name: The block name to render
|
91
145
|
@mixin breakup-block($block-name) {
|
92
|
-
@if index($breakup-included-blocks, $block-name) !=
|
146
|
+
@if breakup-index($breakup-included-blocks, $block-name) != null {
|
93
147
|
@content;
|
94
148
|
}
|
95
149
|
}
|
@@ -113,7 +167,7 @@ $breakup-breakpoints-allow-naked: () !default;
|
|
113
167
|
$allow-naked-list: $breakup-breakpoints-allow-naked, null;
|
114
168
|
}
|
115
169
|
|
116
|
-
$allow-naked: index($allow-naked-list, $breakpoint-name) !=
|
170
|
+
$allow-naked: breakup-index($allow-naked-list, $breakpoint-name) != null;
|
117
171
|
|
118
172
|
|
119
173
|
// For breakpoints, the block name is the same as the breakpoint name
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breakup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
@@ -51,8 +51,11 @@ extensions: []
|
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
53
|
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
54
56
|
- LICENSE.txt
|
55
57
|
- Makefile
|
58
|
+
- PACKAGING.md
|
56
59
|
- README.md
|
57
60
|
- breakup.gemspec
|
58
61
|
- examples/example_allblocks.css
|
@@ -107,4 +110,3 @@ summary: Breakup is a Sass component that allows you to create multiple CSS file
|
|
107
110
|
mobile, tablet and desktop) and fallback files where no styles are wrapped (e.g.
|
108
111
|
for oldIE which does not support media queries).
|
109
112
|
test_files: []
|
110
|
-
has_rdoc:
|