breakpoint 2.5.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1263d888746ab8b6b186632735dff144f2a7dbfb
4
- data.tar.gz: f38e9dad9ad05f562369be6e991db955cb40bc71
3
+ metadata.gz: a19549aebab75696baaac8ac60da9b4ed3dd8609
4
+ data.tar.gz: ae92fe5d232a38dafe025b4416eb6136ee8b30fe
5
5
  SHA512:
6
- metadata.gz: a8f47527bc6412af29e75102612c431ee4a762d8082880c3ca4d5573cbf64b234b2b08d2489a8b5ecd084eb544bb01364e561ccd3cb24ecbf35f658307ef3d46
7
- data.tar.gz: d932d019c16e24fa5082a385832aca4592fb0b123531de4ea09686834d46ef109d9510102c3f74735defc60ff649b626d5b306126e006be15d4812472c434ba0
6
+ metadata.gz: aed7a906df91f6d48f05df735b9df1792d4872890f97d369dfdb1829b3200bdd692cea51dc1028a545f4c78120d3817cc620d59ef7cd78ffbeb12cb4a26253f5
7
+ data.tar.gz: 6d51be88de3f05c8464a685ea0b429261046fa4a71a45ecbc5f7cea16c678b7ae48fdd490cc632b8bd9b696421ef5ce20625538d5d0faf18e99b6227eb45c775
@@ -1,49 +1,82 @@
1
1
  # Changelog
2
2
 
3
- ## 2.2.0 - Nov 23, 2013
3
+ ## 2.6.0
4
+ * **Change** Moved variable settings to new Breakpoint settings. Future versions will deprecate variable settings. Use `@include breakpoint-set()` or `@include bkpt-set()` to change settings, `@include breakpoint-reset()` or `@include bkpt-reset()` to reset settings to their default state. Please update your settings as followins:
5
+ * `$breakpoint-default-media: value;` should become `@include bkpt-set('default media', value);`
6
+ * `$breakpoint-default-feature: value;` should become `@include bkpt-set('default feature', value);`
7
+ * `$breakpoint-default-pair: value;` should become `@include bkpt-set('default pair', value);`
8
+ * `$breakpoint-force-media-all: value;` should become `@include bkpt-set('force all media type', value);`
9
+ * `$breakpoint-to-ems: value;` should become `@include bkpt-set('to ems', value);`
10
+ * `$breakpoint-resolutions: value;` should become `@include bkpt-set('transform resolutions', value);`
11
+ * `$breakpoint-no-queries: value;` should become `@include bkpt-set('no queries', value);`
12
+ * `$breakpoint-no query fallbacks: value;` should become `@include bkpt-set('no query fallbacks', value);`
13
+ * `$breakpoint-base-font-size: value;` should become `@include bkpt-set('base font size', value);`
14
+ * `$breakpoint-legacy-syntax: value;` should become `@include bkpt-set('legacy syntax', value);`
15
+ * **Change** Adding breakpoints for `respond-to` should now be done through the mixin `@include add-breakpoint()` instead of the function call `$breakpoints: add-breakpoint()`. Future versions will deprecate function.
16
+ * **New** Initial support for Libsass 3.1
17
+
18
+ ## 2.5.0
19
+
20
+ ## 2.4.0
21
+
22
+ ## 2.3.0
23
+
24
+ ## 2.2.0
25
+ ### Nov 23, 2013
4
26
  * fix simple or queries
5
27
  * convert respond-to to use sass maps
6
28
  * convert context to use sass maps
7
29
 
8
- ## 2.0.7 - Sept 17th, 2013
30
+ ## 2.0.7
31
+ ### Sept 17th, 2013
9
32
  * fix fallback support for 1.x
10
33
 
11
- ## 2.0.0 - The Past
12
- * Looks like we forgot relase notes for 2.0. oops
34
+ ## 2.0.0
35
+ ### The Past
36
+ * Looks like we forgot release notes for 2.0. oops
13
37
 
14
- ## 1.3 - August 28th, 2012
38
+ ## 1.3
39
+ ### August 28th, 2012
15
40
  * better conversion to base-ems
16
41
  * fix floating point error
17
42
 
18
- ## 1.2 - August 16th, 2012
43
+ ## 1.2
44
+ ### August 16th, 2012
19
45
  * Added ability to force the 'all' media type to be written by setting `$breakpoint-force-media-all: true;`. Defaults to `false`.
20
46
  * Added ability to generate no query fallback code. See the README for full documentaiton.
21
47
 
22
- ## 1.1.1 - July 30, 2012
48
+ ## 1.1.1
49
+ ### July 30, 2012
23
50
  * Added (forgot to include the first time) the ability to query the media type using `breakpoint-get-context('media')`
24
51
 
25
52
 
26
- ## 1.1 - July 29, 2012
53
+ ## 1.1
54
+ ### July 29, 2012
27
55
  * Added function `breakpoint-get-context($feature)` to allow users to get the current media query context
28
56
 
29
- ## 1.0.2 - July 28, 2012
57
+ ## 1.0.2
58
+ ### July 28, 2012
30
59
  * Refixed our 'device-pixel-ratio' conversions because, frankly, the w3c was wrong.
31
60
  * fixed bugs that caused single and triple value single queries to fail. Also bugs with stacking single and triple value queries.
32
61
 
33
- ## 1.0.1 - June 27, 2012
62
+ ## 1.0.1
63
+ ### June 27, 2012
34
64
  * fixed logic error that would print multiple instences of a media type
35
65
 
36
- ## 1.0 - June 22, 2012
66
+ ## 1.0
67
+ ### June 22, 2012
37
68
  * Refactor of the underlying logic to make everything work better and make the world a happy place.
38
69
  * Added default options for Default Feature, Default Media, and Default Feature Pair.
39
70
  * Changed default media from "Screen" to "All".
40
71
  * Added ability to have all px/pt/percentage media queries transformed into em based media queries.
41
72
 
42
- ## 0.3 - June 18, 2012
73
+ ## 0.3
74
+ ### June 18, 2012
43
75
  * Rewrote 'device-pixel-ratio' conversions to change from prefixed nightmarish hell to Resolution standard based on the [W3C Unprefixing -webkit-device-pixel-ratio article](http://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/)
44
76
  * Large README update covering feature set, installation, assumptions, and more.
45
77
 
46
- ## 0.2 - May 24, 2012
78
+ ## 0.2
79
+ ### May 24, 2012
47
80
  * Converted from Sass to SCSS
48
81
  * Converted README examples from Sass to SCSS
49
82
  * Added ability to do min/max easily with any valid feature
@@ -52,5 +85,6 @@
52
85
  * Opera is strange and needs its DPR in a ratio instead of a floating point number, so requires the fraction rubygem and has a numerator/denominator function to accommodate.
53
86
  * Added ability to have single feature/value input be either have feature first or second
54
87
 
55
- ## 0.1 - May 22, 2012
88
+ ## 0.1
89
+ ### May 22, 2012
56
90
  * extract breakpoint from survival kit to this gem
@@ -17,6 +17,8 @@ If you'd prefer the semantic awesomeness of string names to identify your querie
17
17
 
18
18
  * For help with Breakpoint, please ask a question on [Stack Overflow](http://stackoverflow.com/questions/ask) tagged with "breakpoint-sass".
19
19
  * To file an issue with Breakpoint, be it a feature request or a bug report, please use our [Issue Queue](https://github.com/Team-Sass/breakpoint/issues).
20
+ * **Each Separate Bug Report or Feature Request Must Have Its Own Issue**
21
+ * Search in both active issues and closed issues before filing your own. If one already exists, please respond there.
20
22
  * If you are in IRC, the maintainers and many fellow users tend to hang out in the #sass and #compass rooms on irc.freenode.net. Asking in there may get you a quick answer to your question, but we still encourage you to file your inquiry in the appropriate place above to
21
23
 
22
24
  ## Contributing to Breakpoint
@@ -12,6 +12,6 @@ else
12
12
  end
13
13
 
14
14
  module Breakpoint
15
- VERSION = "2.5.0"
16
- DATE = "2014-08-05"
15
+ VERSION = "2.6.1"
16
+ DATE = "2015-05-27"
17
17
  end
@@ -1,29 +1,29 @@
1
1
  //////////////////////////////
2
2
  // Default Variables
3
3
  //////////////////////////////
4
- // Default Features
5
- $breakpoint-default-media: all !default;
6
- $breakpoint-default-feature: min-width !default;
7
- $breakpoint-default-pair: width !default;
4
+ $Breakpoint-Settings: (
5
+ 'default media': all,
6
+ 'default feature': min-width,
7
+ 'default pair': width,
8
8
 
9
- // Default Transforms
10
- $breakpoint-force-media-all: false !default;
11
- $breakpoint-to-ems: false !default;
12
- $breakpoint-resolutions: true !default;
9
+ 'force all media type': false,
10
+ 'to ems': false,
11
+ 'transform resolutions': true,
13
12
 
14
- // Default No Query Options
15
- $breakpoint-no-queries: false !default;
16
- $breakpoint-no-query-fallbacks: false !default;
13
+ 'no queries': false,
14
+ 'no query fallbacks': false,
17
15
 
18
- // Deftault Base Font Size
19
- $breakpoint-base-font-size: 16px !default;
16
+ 'base font size': 16px,
20
17
 
21
- // Legacy Syntax Support
22
- $breakpoint-legacy-syntax: false !default;
18
+ 'legacy syntax': false
19
+ );
20
+
21
+ $breakpoint: () !default;
23
22
 
24
23
  //////////////////////////////
25
24
  // Imports
26
25
  //////////////////////////////
26
+ @import "breakpoint/settings";
27
27
  @import 'breakpoint/context';
28
28
  @import 'breakpoint/helpers';
29
29
  @import 'breakpoint/parsers';
@@ -31,11 +31,15 @@ $breakpoint-legacy-syntax: false !default;
31
31
 
32
32
  @import 'breakpoint/respond-to';
33
33
 
34
+ @import "breakpoint/legacy-settings";
35
+
34
36
  //////////////////////////////
35
37
  // Breakpoint Mixin
36
38
  //////////////////////////////
37
39
 
38
40
  @mixin breakpoint($query, $no-query: false) {
41
+ @include legacy-settings-warning;
42
+
39
43
  // Reset contexts
40
44
  @include private-breakpoint-reset-contexts();
41
45
 
@@ -57,27 +61,27 @@ $breakpoint-legacy-syntax: false !default;
57
61
  }
58
62
 
59
63
  // Print Out Query String
60
- @if not $breakpoint-no-queries {
64
+ @if not breakpoint-get('no queries') {
61
65
  @media #{$query-string} {
62
66
  @content;
63
67
  }
64
68
  }
65
69
 
66
- @if $breakpoint-no-query-fallbacks != false or $breakpoint-no-queries == true {
70
+ @if breakpoint-get('no query fallbacks') != false or breakpoint-get('no queries') == true {
67
71
 
68
- $type: type-of($breakpoint-no-query-fallbacks);
72
+ $type: type-of(breakpoint-get('no query fallbacks'));
69
73
  $print: false;
70
74
 
71
75
  @if ($type == 'bool') {
72
76
  $print: true;
73
77
  }
74
78
  @else if ($type == 'string') {
75
- @if $query-fallback == $breakpoint-no-query-fallbacks {
79
+ @if $query-fallback == breakpoint-get('no query fallbacks') {
76
80
  $print: true;
77
81
  }
78
82
  }
79
83
  @else if ($type == 'list') {
80
- @each $wrapper in $breakpoint-no-query-fallbacks {
84
+ @each $wrapper in breakpoint-get('no query fallbacks') {
81
85
  @if $query-fallback == $wrapper {
82
86
  $print: true;
83
87
  }
@@ -34,7 +34,7 @@ $private-breakpoint-query-count: 0 !default;
34
34
  }
35
35
  @else {
36
36
  @if breakpoint-has-context() and $feature == 'media' {
37
- @return $breakpoint-default-media;
37
+ @return breakpoint-get('default media');
38
38
  }
39
39
  @else {
40
40
  @return false;
@@ -59,7 +59,7 @@ $private-breakpoint-query-count: 0 !default;
59
59
  $v-holder: ();
60
60
  @for $i from 1 to $private-breakpoint-query-count {
61
61
  @if $feature == 'media' {
62
- $v-holder: append($v-holder, $breakpoint-default-media);
62
+ $v-holder: append($v-holder, breakpoint-get('default media'));
63
63
  }
64
64
  @else {
65
65
  $v-holder: append($v-holder, false);
@@ -73,7 +73,7 @@ $private-breakpoint-query-count: 0 !default;
73
73
  $length: length($v-holder);
74
74
  @for $i from $length to $private-breakpoint-query-count - 1 {
75
75
  @if $feature == 'media' {
76
- $v-holder: append($v-holder, $breakpoint-default-media);
76
+ $v-holder: append($v-holder, breakpoint-get('default media'));
77
77
  }
78
78
  @else {
79
79
  $v-holder: append($v-holder, false);
@@ -5,14 +5,14 @@
5
5
  $value-unit: unit($value);
6
6
 
7
7
  // Will convert relative EMs into root EMs.
8
- @if $breakpoint-base-font-size and type-of($breakpoint-base-font-size) == 'number' and $value-unit == 'em' {
9
- $base-unit: unit($breakpoint-base-font-size);
8
+ @if breakpoint-get('base font size') and type-of(breakpoint-get('base font size')) == 'number' and $value-unit == 'em' {
9
+ $base-unit: unit(breakpoint-get('base font size'));
10
10
 
11
11
  @if $base-unit == 'px' or $base-unit == '%' or $base-unit == 'em' or $base-unit == 'pt' {
12
- @return base-conversion($value) / base-conversion($breakpoint-base-font-size) * 1em;
12
+ @return base-conversion($value) / base-conversion(breakpoint-get('base font size')) * 1em;
13
13
  }
14
14
  @else {
15
- @warn '#{$breakpoint-base-font-size} is not set in valid units for font size!';
15
+ @warn '#{breakpoint-get(\'base font size\')} is not set in valid units for font size!';
16
16
  @return false;
17
17
  }
18
18
  }
@@ -137,7 +137,7 @@ $breakpoint-single-string-features: 'color',
137
137
  @function breakpoint-is-resolution($feature) {
138
138
  $resolutions: 'device-pixel-ratio', 'dpr';
139
139
 
140
- @if $breakpoint-resolutions {
140
+ @if breakpoint-get('transform resolutions') {
141
141
  $resolutions: append($resolutions, 'resolution');
142
142
  }
143
143
 
@@ -0,0 +1,50 @@
1
+ @mixin legacy-settings-warning {
2
+ $legacyVars: (
3
+ 'default-media': 'default media',
4
+ 'default-feature': 'default feature',
5
+ 'force-media-all': 'force all media type',
6
+ 'to-ems': 'to ems',
7
+ 'resolutions': 'transform resolutions',
8
+ 'no-queries': 'no queries',
9
+ 'no-query-fallbacks': 'no query fallbacks',
10
+ 'base-font-size': 'base font size',
11
+ 'legacy-syntax': 'legacy syntax'
12
+ );
13
+
14
+ @each $legacy, $new in $legacyVars {
15
+ @if global-variable-exists('breakpoint-' + $legacy) {
16
+ @warn "In order to avoid variable namspace collisions, we have updated the way to change settings for Breakpoint. Please change all instances of `$breakpoint-#{$legacy}: {{setting}}` to `@include breakpoint-set('#{$new}', {{setting}})`. Variable settings, as well as this warning will be deprecated in a future release."
17
+ }
18
+ };
19
+
20
+ //////////////////////////////
21
+ // Hand correct each setting
22
+ //////////////////////////////
23
+ @if global-variable-exists('breakpoint-default-media') and $breakpoint-default-media != breakpoint-get('default media') {
24
+ @include breakpoint-set('default media', $breakpoint-default-media);
25
+ }
26
+ @if global-variable-exists('breakpoint-default-feature') and $breakpoint-default-feature != breakpoint-get('default feature') {
27
+ @include breakpoint-set('default feature', $breakpoint-default-feature);
28
+ }
29
+ @if global-variable-exists('breakpoint-force-media-all') and $breakpoint-force-media-all != breakpoint-get('force all media type') {
30
+ @include breakpoint-set('force all media type', $breakpoint-force-media-all);
31
+ }
32
+ @if global-variable-exists('breakpoint-to-ems') and $breakpoint-to-ems != breakpoint-get('to ems') {
33
+ @include breakpoint-set('to ems', $breakpoint-to-ems);
34
+ }
35
+ @if global-variable-exists('breakpoint-resolutions') and $breakpoint-resolutions != breakpoint-get('transform resolutions') {
36
+ @include breakpoint-set('transform resolutions', $breakpoint-resolutions);
37
+ }
38
+ @if global-variable-exists('breakpoint-no-queries') and $breakpoint-no-queries != breakpoint-get('no queries') {
39
+ @include breakpoint-set('no queries', $breakpoint-no-queries);
40
+ }
41
+ @if global-variable-exists('breakpoint-no-query-fallbacks') and $breakpoint-no-query-fallbacks != breakpoint-get('no query fallbacks') {
42
+ @include breakpoint-set('no query fallbacks', $breakpoint-no-query-fallbacks);
43
+ }
44
+ @if global-variable-exists('breakpoint-base-font-size') and $breakpoint-base-font-size != breakpoint-get('base font size') {
45
+ @include breakpoint-set('base font size', $breakpoint-base-font-size);
46
+ }
47
+ @if global-variable-exists('breakpoint-legacy-syntax') and $breakpoint-legacy-syntax != breakpoint-get('legacy syntax') {
48
+ @include breakpoint-set('legacy syntax', $breakpoint-legacy-syntax);
49
+ }
50
+ }
@@ -44,7 +44,7 @@ $Memo-Exists: function-exists(memo-get) and function-exists(memo-set);
44
44
  $or-list: if(list-separator($query) == 'comma', true, false);
45
45
 
46
46
 
47
- @if ($or-list == false and $breakpoint-legacy-syntax == false) {
47
+ @if ($or-list == false and breakpoint-get('legacy syntax') == false) {
48
48
  $query-string: breakpoint-parse($query);
49
49
  }
50
50
  @else {
@@ -57,7 +57,7 @@ $Memo-Exists: function-exists(memo-get) and function-exists(memo-set);
57
57
  $length: $length - 1;
58
58
  }
59
59
 
60
- @if ($breakpoint-legacy-syntax == true) {
60
+ @if (breakpoint-get('legacy syntax') == true) {
61
61
  $mq: ();
62
62
 
63
63
  @for $i from 1 through $length {
@@ -112,11 +112,11 @@ $Memo-Exists: function-exists(memo-get) and function-exists(memo-set);
112
112
  // Set up Media Type
113
113
  $query-print: '';
114
114
 
115
- $force-all: (($breakpoint-force-media-all == true) and ($breakpoint-default-media == 'all'));
115
+ $force-all: ((breakpoint-get('force all media type') == true) and (breakpoint-get('default media') == 'all'));
116
116
  $empty-media: true;
117
- @if ($force-all == true) or ($breakpoint-default-media != 'all') {
117
+ @if ($force-all == true) or (breakpoint-get('default media') != 'all') {
118
118
  // Force the print of the default media type if (force all is true and default media type is all) or (default media type is not all)
119
- $query-print: $breakpoint-default-media;
119
+ $query-print: breakpoint-get('default media');
120
120
  $empty-media: false;
121
121
  }
122
122
 
@@ -201,7 +201,7 @@ $Memo-Exists: function-exists(memo-get) and function-exists(memo-set);
201
201
  @if length($v-holder) < $private-breakpoint-query-count {
202
202
  @for $i from $length to $private-breakpoint-query-count {
203
203
  @if $f == 'media' {
204
- $v-holder: append($v-holder, $breakpoint-default-media);
204
+ $v-holder: append($v-holder, breakpoint-get('default media'));
205
205
  }
206
206
  @else {
207
207
  $v-holder: append($v-holder, false);
@@ -2,36 +2,45 @@
2
2
  // Default the Breakpoints variable
3
3
  ////////////////////////
4
4
  $breakpoints: () !default;
5
+ $BREAKPOINTS: () !default;
5
6
 
6
7
  ////////////////////////
7
8
  // Respond-to API Mixin
8
9
  ////////////////////////
9
10
  @mixin respond-to($context, $no-query: false) {
10
- @if type-of($breakpoints) != 'map' {
11
+ @if length($breakpoints) > 0 and length($BREAKPOINTS) == 0 {
12
+ @warn "In order to avoid variable namespace collisions, we have updated the way to add breakpoints for respond-to. Please change all instances of `$breakpoints: add-breakpoint()` to `@include add-breakpoint()`. The `add-breakpoint()` function will be deprecated in a future release.";
13
+ $BREAKPOINTS: $breakpoints !global;
14
+ $breakpoints: () !global;
15
+ }
16
+
17
+ @if type-of($BREAKPOINTS) != 'map' {
11
18
  // Just in case someone writes gibberish to the $breakpoints variable.
12
- @warn "Your breakpoints aren't a map! See https://github.com/snugug/respond-to#api if you'd like a reminder on how to use Respond-to";
19
+ @warn "Your breakpoints aren't a map! `respond-to` expects a map. Please check the value of $BREAKPOINTS variable.";
13
20
  @content;
14
21
  }
15
- @else if map-has-key($breakpoints, $context) {
16
- @include breakpoint(map-get($breakpoints, $context), $no-query) {
22
+ @else if map-has-key($BREAKPOINTS, $context) {
23
+ @include breakpoint(map-get($BREAKPOINTS, $context), $no-query) {
17
24
  @content;
18
25
  }
19
26
  }
20
- @else if not map-has-key($breakpoints, $context) {
27
+ @else if not map-has-key($BREAKPOINTS, $context) {
21
28
  @warn "`#{$context}` isn't a defined breakpoint! Please add it using `$breakpoints: add-breakpoint(`#{$context}`, $value);`";
22
29
  @content;
23
30
  }
24
31
  @else {
25
- @warn "You haven't created any breakpoints yet! Make some already! See https://github.com/snugug/respond-to#api if you'd like a reminder on how to use Respond-to";
32
+ @warn "You haven't created any breakpoints yet! Make some already! `@include add-breakpoint($name, $bkpt)`";
26
33
  @content;
27
34
  }
28
35
  }
29
36
 
30
37
  //////////////////////////////
31
38
  // Add Breakpoint to Breakpoints
39
+ // TODO: Remove function in next release
32
40
  //////////////////////////////
33
41
  @function add-breakpoint($name, $bkpt, $overwrite: false) {
34
42
  $output: ($name: $bkpt);
43
+
35
44
  @if length($breakpoints) == 0 {
36
45
  @return $output;
37
46
  }
@@ -44,4 +53,30 @@ $breakpoints: () !default;
44
53
  @return map-merge($breakpoints, $output);
45
54
  }
46
55
  }
47
- }
56
+ }
57
+
58
+ @mixin add-breakpoint($name, $bkpt, $overwrite: false) {
59
+ $output: ($name: $bkpt);
60
+
61
+ @if length($BREAKPOINTS) == 0 {
62
+ $BREAKPOINTS: $output !global;
63
+ }
64
+ @else {
65
+ @if map-has-key($BREAKPOINTS, $name) and $overwrite != true {
66
+ @warn "You already have a breakpoint named `#{$name}`, please choose another breakpoint name, or pass in `$overwrite: true` to overwrite the previous breakpoint.";
67
+ $BREAKPOINTS: $BREAKPOINTS !global;
68
+ }
69
+ @else if not map-has-key($BREAKPOINTS, $name) or $overwrite == true {
70
+ $BREAKPOINTS: map-merge($BREAKPOINTS, $output) !global;
71
+ }
72
+ }
73
+ }
74
+
75
+ @function get-breakpoint($name: false) {
76
+ @if $name == false {
77
+ @return $BREAKPOINTS;
78
+ }
79
+ @else {
80
+ @return map-get($BREAKPOINTS, $name);
81
+ }
82
+ }
@@ -0,0 +1,71 @@
1
+ //////////////////////////////
2
+ // Has Setting
3
+ //////////////////////////////
4
+ @function breakpoint-has($setting) {
5
+ @if map-has-key($breakpoint, $setting) {
6
+ @return true;
7
+ }
8
+ @else {
9
+ @return false;
10
+ }
11
+ }
12
+
13
+ //////////////////////////////
14
+ // Get Settings
15
+ //////////////////////////////
16
+ @function breakpoint-get($setting) {
17
+ @if breakpoint-has($setting) {
18
+ @return map-get($breakpoint, $setting);
19
+ }
20
+ @else {
21
+ @return map-get($Breakpoint-Settings, $setting);
22
+ }
23
+ }
24
+
25
+ //////////////////////////////
26
+ // Set Settings
27
+ //////////////////////////////
28
+ @function breakpoint-set($setting, $value) {
29
+ @if (str-index($setting, '-') or str-index($setting, '_')) and str-index($setting, ' ') == null {
30
+ @warn "Words in Breakpoint settings should be separated by spaces, not dashes or underscores. Please replace dashes and underscores between words with spaces. Settings will not work as expected until changed.";
31
+ }
32
+ $breakpoint: map-merge($breakpoint, ($setting: $value)) !global;
33
+ @return true;
34
+ }
35
+
36
+ @mixin breakpoint-change($setting, $value) {
37
+ $breakpoint-change: breakpoint-set($setting, $value);
38
+ }
39
+
40
+ @mixin breakpoint-set($setting, $value) {
41
+ @include breakpoint-change($setting, $value);
42
+ }
43
+
44
+ @mixin bkpt-change($setting, $value) {
45
+ @include breakpoint-change($setting, $value);
46
+ }
47
+ @mixin bkpt-set($setting, $value) {
48
+ @include breakpoint-change($setting, $value);
49
+ }
50
+
51
+ //////////////////////////////
52
+ // Remove Setting
53
+ //////////////////////////////
54
+ @function breakpoint-reset($settings...) {
55
+ @if length($settings) == 1 {
56
+ $settings: nth($settings, 1);
57
+ }
58
+
59
+ @each $setting in $settings {
60
+ $breakpoint: map-remove($breakpoint, $setting) !global;
61
+ }
62
+ @return true;
63
+ }
64
+
65
+ @mixin breakpoint-reset($settings...) {
66
+ $breakpoint-reset: breakpoint-reset($settings);
67
+ }
68
+
69
+ @mixin bkpt-reset($settings...) {
70
+ $breakpoint-reset: breakpoint-reset($settings);
71
+ }
@@ -7,7 +7,7 @@
7
7
  $leader: 'and ';
8
8
  }
9
9
 
10
- @if $breakpoint-resolutions and $query-resolution {
10
+ @if breakpoint-get('transform resolutions') and $query-resolution {
11
11
  $resolutions: breakpoint-make-resolutions($query-resolution);
12
12
  $length: length($resolutions);
13
13
  $query-holder: '';
@@ -1,5 +1,5 @@
1
1
  @function breakpoint-parse-default-pair($first, $second) {
2
- $default: $breakpoint-default-pair;
2
+ $default: breakpoint-get('default pair');
3
3
  $min: '';
4
4
  $max: '';
5
5
 
@@ -12,7 +12,7 @@
12
12
  $context-setter: private-breakpoint-set-context(max-#{$default}, $max);
13
13
 
14
14
  // Make them EMs if need be
15
- @if ($breakpoint-to-ems == true) {
15
+ @if (breakpoint-get('to ems') == true) {
16
16
  $min: breakpoint-to-base-em($min);
17
17
  $max: breakpoint-to-base-em($max);
18
18
  }
@@ -14,7 +14,7 @@
14
14
  // Set Context
15
15
  $context-setter: private-breakpoint-set-context($feature, $value);
16
16
 
17
- @if ($breakpoint-to-ems == true) {
17
+ @if (breakpoint-get('to ems') == true) {
18
18
  $value: breakpoint-to-base-em($value);
19
19
  }
20
20
 
@@ -7,13 +7,16 @@
7
7
  $feature: $first;
8
8
  $value: $second;
9
9
  }
10
- @else {
10
+ @else if (breakpoint-string-value($second) == true) {
11
11
  $feature: $second;
12
12
  $value: $first;
13
13
  }
14
+ @else {
15
+ @warn "Neither #{$first} nor #{$second} is a valid media query name.";
16
+ }
14
17
 
15
18
  // Set Context
16
19
  $context-setter: private-breakpoint-set-context($feature, $value);
17
20
 
18
21
  @return '(#{$feature}: #{$value})';
19
- }
22
+ }
@@ -1,10 +1,10 @@
1
1
  @function breakpoint-parse-default($feature) {
2
- $default: $breakpoint-default-feature;
2
+ $default: breakpoint-get('default feature');
3
3
 
4
4
  // Set Context
5
5
  $context-setter: private-breakpoint-set-context($default, $feature);
6
6
 
7
- @if ($breakpoint-to-ems == true) and (type-of($feature) == 'number') {
7
+ @if (breakpoint-get('to ems') == true) and (type-of($feature) == 'number') {
8
8
  @return '#{$default}: #{breakpoint-to-base-em($feature)}';
9
9
  }
10
10
  @else {
@@ -9,7 +9,7 @@
9
9
  $context-setter: private-breakpoint-set-context(max-#{$feature}, $max);
10
10
 
11
11
  // Make them EMs if need be
12
- @if ($breakpoint-to-ems == true) {
12
+ @if (breakpoint-get('to ems') == true) {
13
13
  $min: breakpoint-to-base-em($min);
14
14
  $max: breakpoint-to-base-em($max);
15
15
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breakpoint
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mason Wendell
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-05 00:00:00.000000000 Z
12
+ date: 2015-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -47,15 +47,17 @@ executables: []
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
- - README.markdown
51
- - CHANGELOG.markdown
50
+ - README.md
51
+ - CHANGELOG.md
52
52
  - lib/breakpoint.rb
53
53
  - stylesheets/_breakpoint.scss
54
54
  - stylesheets/breakpoint/_context.scss
55
55
  - stylesheets/breakpoint/_helpers.scss
56
+ - stylesheets/breakpoint/_legacy-settings.scss
56
57
  - stylesheets/breakpoint/_no-query.scss
57
58
  - stylesheets/breakpoint/_parsers.scss
58
59
  - stylesheets/breakpoint/_respond-to.scss
60
+ - stylesheets/breakpoint/_settings.scss
59
61
  - stylesheets/breakpoint/parsers/_double.scss
60
62
  - stylesheets/breakpoint/parsers/_query.scss
61
63
  - stylesheets/breakpoint/parsers/_resolution.scss