breakup 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "sass", "~>3.4.0"
4
+
data/Gemfile.lock ADDED
@@ -0,0 +1,10 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ sass (3.4.5)
5
+
6
+ PLATFORMS
7
+ ruby
8
+
9
+ DEPENDENCIES
10
+ sass (~> 3.4.0)
data/Makefile CHANGED
@@ -22,7 +22,7 @@ build/libsass/test/%.css: test/%.scss
22
22
 
23
23
  build/rubysass/test/%.css: test/%.scss
24
24
  mkdir -p build/rubysass/test
25
- sass $< $@
25
+ bundle exec sass --sourcemap=none $< $@
26
26
 
27
27
 
28
28
  test: $(source_files) $(libsass_output_files) $(rubysass_output_files)
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 distributed as a Compass plugin (though it is written in pure SCSS,
35
- so works as a stand-alone file without a dependancy on Compass).
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
- Alternatively, if you don't want to be dependant upon Compass, you can copy
42
- [stylesheets/_breakup.scss](stylesheets/_breakup.scss) into your project and
43
- `@import` it from there.
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
 
@@ -1,3 +1,3 @@
1
1
  module Breakup
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "breakup-sass",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "author": {
5
5
  "name": "Ben Scott",
6
6
  "email": "ben@reload.me.uk"
@@ -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) != false {
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) != false;
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.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-07-16 00:00:00.000000000 Z
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: